feat(accounts): fresh accounts implementation

This commit is contained in:
Darko Gjorgjijoski
2026-08-20 23:48:22 +02:00
parent 973fda1df6
commit d5dc446b24
42 changed files with 3768 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
namespace App\Domains\Accounts\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
/**
* Guards the bulk removal of staff accounts.
*
* Every submitted id has to name an account, but the check reaches across the
* whole installation rather than the active company: an id belonging to another
* tenant clears validation here and is then dropped by the controller's
* company-scoped lookup, so the batch skips it without complaint. Kept as it
* stands.
*/
class DeleteMemberRequest extends FormRequest
{
/**
* Nothing is settled at this layer — the controller asks Bouncer for the
* `delete multiple users` ability before anything is touched.
*/
public function authorize(): bool
{
return true;
}
/**
* A non-empty `users` list, each entry naming a row that exists.
*
* @return array<string, array<int, mixed>>
*/
public function rules(): array
{
return [
'users' => ['required'],
'users.*' => ['required', Rule::exists('users', 'id')],
];
}
}