30 lines
598 B
PHP
30 lines
598 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* 管理员用户角色同步请求。
|
|
*
|
|
* @see AdminUserRoleSyncController
|
|
*/
|
|
final class AdminUserRoleSyncRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, mixed>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'role_slugs' => ['required', 'array', 'min:1'],
|
|
'role_slugs.*' => ['string', 'max:64', 'distinct', 'exists:admin_roles,slug'],
|
|
];
|
|
}
|
|
}
|