v-for="product in products"
v-for="list in product.lists"
list.name
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;
}
return $this->lists()->wherePivot('user_id', Auth::id());
$file = Auth::user()
->files()
->get()
->where('slug', $file_slug)
->first();
return $this->$model()->count()>0;
Но т.к. авторизованному пользователю принадлежать только списки
[зеленый,желтый]
мы должны получить после запроса: