create base thing such as Roler permission Expert and user Management and their dependency for Admin
This commit is contained in:
52
backend/app/Admin/Requests/UserManagement/UpdateRequest.php
Normal file
52
backend/app/Admin/Requests/UserManagement/UpdateRequest.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin\Requests\UserManagement;
|
||||
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
/**
|
||||
* @property mixed $user
|
||||
*/
|
||||
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 [
|
||||
'username' => ['string', 'max:255',
|
||||
Rule::unique('users', 'username')->ignore($this->user->id),],
|
||||
'first_name' => 'string|max:255',
|
||||
'last_name' => 'string|max:255',
|
||||
'national_id' => ['string', 'max:20',
|
||||
Rule::unique('users', 'national_id')->ignore($this->user->id),],
|
||||
'password' => 'nullable|string|min:8|confirmed',
|
||||
'email' => ['email', 'max:255',
|
||||
Rule::unique('users', 'email')->ignore($this->user->id),],
|
||||
'birthday' => 'nullable|date',
|
||||
'phone_number' => ['string', 'max:20',
|
||||
Rule::unique('users', 'phone_number')->ignore($this->user->id),],
|
||||
'postal_code' => 'nullable|string|max:20',
|
||||
'address' => 'nullable|string|max:1000',
|
||||
'province_id' => 'integer|exists:provinces,id',
|
||||
'city_id' => 'integer|exists:cities,id',
|
||||
'key_status' => 'nullable|string|max:255',
|
||||
'level' => 'nullable|string|max:255',
|
||||
'tax_id' => 'nullable|string|max:50',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user