36 lines
961 B
PHP
36 lines
961 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\Dashboard\UserManagement;
|
|
|
|
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, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'province_id' => 'required|exists:provinces,id',
|
|
'edarate_ostani_id' => 'exists:edarate_ostanis,id',
|
|
'city_id' => 'exists:cities,id',
|
|
'edarate_shahri_id' => 'exists:edarate_shahris,id',
|
|
'username' => 'required|unique:users,username',
|
|
'national_code' => 'unique:users,national_code',
|
|
'password' => 'required|min:8',
|
|
|
|
];
|
|
}
|
|
}
|