43 lines
1.4 KiB
PHP
43 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V3\Dashboard\UserManagement;
|
|
|
|
use Illuminate\Contracts\Validation\ValidationRule;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class StoreExrtraRequest 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 [
|
|
'edarate_ostani_id' => 'nullable|exists:edarate_ostanis,id|required_without:edarate_shahri_id',
|
|
'edarate_shahri_id' => 'nullable|exists:edarate_shahris,id|required_without:edarate_ostani_id',
|
|
'province_id' => 'required|exists:provinces,id',
|
|
'city_id' => 'exists:cities,id',
|
|
'username' => 'required|unique:users,username',
|
|
'national_code' => 'unique:users,national_code',
|
|
'password' => 'required|string|confirmed|min:8',
|
|
'first_name' => 'required|string',
|
|
'last_name' => 'required|string',
|
|
'position' => 'string',
|
|
'mobile' => 'required|string',
|
|
'degree' => 'string',
|
|
'major' => 'string',
|
|
'avatar' => 'required|file|mimes:pdf,jpg,jpeg,png',
|
|
];
|
|
}
|
|
}
|