New-Thanasoft/thanasoft-back/app/Http/Requests/UpdateUserRequest.php
nyavokevin 56b0c50111 feat(auth): add employee user linking and password setup flow
Add user management endpoints and link employees to existing users
through `user_id`, including API resources, validation, repository
support, and database migrations.

Introduce a two-step login flow that checks email first and lets users
without a password create one before signing in.

Update the employee detail UI with a dedicated user tab and refresh the
employee and intervention side navigation to support the new account
management flow.
2026-04-08 13:31:57 +03:00

36 lines
845 B
PHP

<?php
declare(strict_types=1);
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Password;
class UpdateUserRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
/**
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<int, mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255'],
'email' => [
'required',
'string',
'email',
'max:255',
Rule::unique('users', 'email')->ignore($this->route('user')),
],
'password' => ['nullable', 'string', Password::min(8)],
];
}
}