updade and fix service and request for create user
This commit is contained in:
@@ -25,8 +25,21 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'province_id' => 'required|exists:provinces,id',
|
||||
'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', 'city_id' => 'exists:cities,id',
|
||||
'edarate_ostani_id' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
Rule::exists('edarate_ostani', 'id'),
|
||||
Rule::prohibitedIf(fn () => filled($this->input('edarate_shahri_id'))),
|
||||
Rule::requiredIf(fn () => blank($this->input('edarate_shahri_id'))),
|
||||
],
|
||||
'edarate_shahri_id' => [
|
||||
'nullable',
|
||||
'integer',
|
||||
Rule::exists('edarate_shahri', 'id'),
|
||||
Rule::prohibitedIf(fn () => filled($this->input('edarate_ostani_id'))),
|
||||
Rule::requiredIf(fn () => blank($this->input('edarate_ostani_id'))),
|
||||
],
|
||||
'city_id' => 'exists:cities,id',
|
||||
'username' => [Rule::unique('users', 'username')->ignore($this->user->id)],
|
||||
'national_code' => ['required', Rule::unique('users', 'national_code')->ignore($this->user->id)],
|
||||
'first_name' => 'required|string',
|
||||
|
||||
Reference in New Issue
Block a user