26 lines
703 B
PHP
26 lines
703 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
final class AdminRoleStoreRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'slug' => ['required', 'string', 'max:64', 'regex:/^[a-z0-9_\\-]+$/', 'unique:admin_roles,slug'],
|
|
'name' => ['required', 'string', 'max:128'],
|
|
'description' => ['nullable', 'string', 'max:65535'],
|
|
'status' => ['sometimes', 'integer', 'in:0,1'],
|
|
'permission_slugs' => ['sometimes', 'array'],
|
|
'permission_slugs.*' => ['string', 'max:128'],
|
|
];
|
|
}
|
|
}
|