create base thing such as Roler permission Expert and user Management and their dependency for Admin

This commit is contained in:
2026-05-12 13:58:40 +03:30
parent ea68943354
commit 12736d53c5
21 changed files with 1279 additions and 17 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Admin\Requests\RoleManagement;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
/**
* @property mixed $role
*/
class UpdateRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, ValidationRule|array|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255', Rule::unique('roles', 'name')->ignore($this->role->id)],
'permissions' => 'required|array',
'permissions.*.name' => 'required|string|exists:permissions,name',
];
}
}