Answer the question
In order to leave comments, you need to log in
What's wrong with the city variable?
Code in the request file.
public function rules()
{
$other_country_id = (new Country)->getId('other_country');
if (!$this->input('id')) {
$phone = [
'phone' => 'required|string|max:30|unique:users,phone'
];
}else{
$phone = [
'phone' => 'required|string|max:30'
];
}
if ($country_id=$this->input('country_id')!==$other_country_id) {
$city = [
'city_id' => 'required|integer|nullable|max:10'
];
}
if ($country_id==$other_country_id) {
$сity = [
'other_country' => 'required|string|nullable|max:100',
'other_code' => 'required|string|nullable|max:20',
'other_city' => 'required|string|nullable|max:100'
];
}
$websiteAndAddress = [
'website' => 'url|nullable|max:50',
'address' => 'string|nullable|max:300'
];
$merge = array_merge($phone, $сity, $websiteAndAddress);
return $merge;
}
$city = [
'city_id' => 'required|integer|nullable|max:10'
];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question