D
D
dj_maestro2017-03-23 02:43:49
Laravel
dj_maestro, 2017-03-23 02:43:49

Is the database organized correctly and is such a query effective in Laravel?

45533ef414a94d24b9c61c385e4b058f.png
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

1 answer(s)
A
Alexander Aksentiev, 2017-03-23
@Sanasol

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 question

Ask a Question

731 491 924 answers to any question