add new role functionality

This commit is contained in:
Saufi
2026-05-11 12:29:11 +08:00
parent a300eced76
commit eaf0ba7a4d
7 changed files with 176 additions and 4 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class StoreRoleRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return true;
}
/**
* @return array<string, ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:255', 'unique:roles,name'],
'description' => ['nullable', 'string', 'max:500'],
];
}
}