АЗ
Но тут решили сначала попинать пациента, чтобы понять чего мы от него хотим. А потом уже делать на чистовую.
Size: a a a
АЗ
SD
T
RE
$obj->with( ['cities' => function ( $query ){
$query->select('cities.id');
}] )->get();АС
$obj->with( ['cities' => function ( $query ){
$query->select('cities.id');
}] )->get();ИБ
\App\Models\Admin\Catalog::with(['category' => function($query)
{
$query->select('category.id');
}])->get()
RE
АС
АС
\App\Models\Admin\Catalog::with(['category' => function($query)
{
$query->select('category.id');
}])->get()
RE
ИБ
\App\Models\Admin\Catalog::with(['category' => function($query)
{
$query->where('id', 9);
}])->get()
EG
\App\Models\Admin\Catalog::with(['category' => function($query)
{
$query->where('id', 9);
}])->get()
ИБ
ИБ
EG
АС
\App\Models\Admin\Catalog::with(['category' => function($query)
{
$query->where('id', 9);
}])->get()
АС
ИБ
public function category()
{
return $this->belongsToMany(Category::class, 'category_product', 'category_id','product_id');
}
ИБ