koel/app/Http/Requests/API/UserStoreRequest.php
2022-07-04 10:36:39 +02:00

24 lines
529 B
PHP

<?php
namespace App\Http\Requests\API;
use Illuminate\Validation\Rules\Password;
/**
* @property-read string $password
* @property-read string $name
* @property-read string $email
*/
class UserStoreRequest extends Request
{
/** @return array<mixed> */
public function rules(): array
{
return [
'name' => 'required',
'email' => 'required|email|unique:users',
'password' => ['required', Password::defaults()],
'is_admin' => 'sometimes',
];
}
}