koel/app/Http/Requests/API/UserStoreRequest.php
2020-12-22 21:11:22 +01:00

28 lines
568 B
PHP

<?php
namespace App\Http\Requests\API;
/**
* @property string $password
* @property string $name
* @property string $email
* @property bool $is_admin
*/
class UserStoreRequest extends Request
{
public function authorize(): bool
{
return auth()->user()->is_admin;
}
/** @return array<mixed> */
public function rules(): array
{
return [
'name' => 'required',
'email' => 'required|email|unique:users',
'password' => 'required',
'is_admin' => 'required',
];
}
}