create base thing such as Roler permission Expert and user Management and their dependency for Admin
This commit is contained in:
35
backend/app/Admin/Requests/RoleManagement/UpdateRequest.php
Normal file
35
backend/app/Admin/Requests/RoleManagement/UpdateRequest.php
Normal 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',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user