41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Admin\Requests\UserManagement;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreRequest 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' => 'required|string|max:255|unique:users,username',
|
|
'first_name' => 'required|string|max:255',
|
|
'last_name' => 'required|string|max:255',
|
|
'national_id' => 'required|string|max:20|unique:users,national_id',
|
|
'password' => 'required|string|min:6|confirmed',
|
|
'email' => 'required|email|max:255|unique:users,email',
|
|
'birth_date' => 'nullable|date',
|
|
'phone_number' => 'required|string|max:20|unique:users,phone_number',
|
|
'postal_code' => 'nullable|string|max:20',
|
|
'address' => 'nullable|string|max:1000',
|
|
'province_id' => 'required|integer|exists:provinces,id',
|
|
'city_id' => 'required|integer|exists:cities,id',
|
|
];
|
|
}
|
|
}
|