$company->toJson();return response()->json($company);$query->where('lists.user_id', Auth::id());$products=Product::with(['lists' => function($query)
{
$query->where('lists.user_id', Auth::id())->with('color');
}]);$сity = [
'other_country' => 'required|string|max:100',
'other_code' => 'required|string|max:20',
'other_city' => 'required|string|max:100'
];
dd($city);if (!Auth::user()->phone) {
$phone = [
'phone' => 'required|string|max:30|unique:users,phone'
];
}else{
$phone = [
'phone' => 'required|string|max:30'
];
}
$country_id = 2;
if ($country_id!==2) {
$city = [
'city_id' => 'required|integer|max:10'
];
}
if ($country_id==2) {
$сity = [
'other_country' => 'required|string|max:100',
'other_code' => 'required|string|max:20',
'other_city' => 'required|string|max:100'
];
}
$websiteAndAddress = [
'website' => 'url|nullable|max:50',
'address' => 'string|nullable|max:300'
];
$merge = array_merge($phone, $city, $websiteAndAddress);
dd($merge);Велосипед [зеленый, красный, синий, желтый, оранжевый]
Самокат [зеленый, красный, оранжевый]
Мотороллер [][зеленый,желтый]Велосипед [зеленый, желтый]
Самокат [зеленый]
Мотороллер []