feat: add the admin list for admin panel

This commit is contained in:
2026-08-19 15:35:15 +03:30
parent 5fd71b5e85
commit 688021caf0
3 changed files with 284 additions and 0 deletions
@@ -0,0 +1,62 @@
<?php
namespace App\Http\Requests\Admins;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class AdminUserPostRequest 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<mixed>|string>
*/
public function rules(): array
{
return [
'first_name' => [
'required',
'string',
'min:3',
'max:150',
'persian_alpha',
],
'last_name' => [
'required',
'string',
'min:3',
'max:150',
'persian_alpha',
],
'email'=> [
'required',
'email',
Rule::unique('users', 'email')->ignore($this->route('user'))],
'mobile'=> [
'required',
'string',
'digits:11',
'ir_mobile:zero',
Rule::unique('users', 'mobile')->ignore($this->route('user'))],
'user_province' => [
'nullable'
],
'user_city' => [
'nullable'
],
];
}
}