N
N
Nubbb2020-05-30 15:49:31
Laravel
Nubbb, 2020-05-30 15:49:31

Display laravel product categories?

how to display categories of such a plan, with an indication of nesting,
qqOfL.png
while displaying all categories like this

$categories = DB::table('categories')
            ->LeftJoin('category_descriptions','category_descriptions.category_id','=','categories.id')
            ->select('categories.*','category_descriptions.name as category')
            ->where('category_descriptions.language_id','=', 1)
            ->orderBy('categories.id', 'ASC')->paginate(12);

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question