change two item in fromrequest
This commit is contained in:
@@ -25,20 +25,8 @@ class UpdateRequest extends FormRequest
|
||||
{
|
||||
return [
|
||||
'province_id' => 'required|exists:provinces,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'))),
|
||||
],
|
||||
'edarate_ostani_id' => 'exists:edarate_ostani,id|integer|prohibited_if:edarate_shahri_id,!=,null',
|
||||
'edarate_shahri_id' => 'exists:edarate_shahri,id|integer|prohibited_if:edarate_ostani_id,!=,null',
|
||||
'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)],
|
||||
|
||||
Reference in New Issue
Block a user