Answer the question
In order to leave comments, you need to log in
Is the database organized correctly and is such a query effective in Laravel?
and here is the request itself - I select categories for the corresponding brands ...
public function getCategories(){
$categories = $this->select('id', 'name')->with(['categories'=>function($query){
$query->select('brand_id', 'name');
}])->get();
return $categories;
}
Answer the question
In order to leave comments, you need to log in
What's the question?
You have only one category, it is difficult to spoil something, there is nothing complicated in the request.
And for zakaz_tovar, dostavka, etc. I want to hit, honestly. Is it really difficult to open google translate if you don't know the word.
Moreover, there are already orders and products, order(s)_products.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question