A
A
an5432019-02-08 07:20:31
Laravel
an543, 2019-02-08 07:20:31

Laravel how to correctly display the category menu in the left sidebar?

Good day everyone, tell me how to properly display the menu in the left sidebar on all pages, I did this:

<!-- app.blade -->
@include('layouts.header')
@include('layouts.left_sidebar')
      
  @section('content')
  @Show
               
@include('layouts.right_sidebar')
@include('layouts.footer')
   
<!-- left_sidebar-->

   <h3>Рубрикатор </h3>
               @include('layouts.menu_categories')   

<!-- menu_categories -->
@foreach ($categories as $category)

 @if ($category->children->where('published', 1)->count())

  <p  {{$category->name}}</a></b></p>
@endif
@endforeach

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad, 2019-02-08
@Result007

If you have data that you want to display on any page, I advise you to take a look at Laravel View Composer

G
gomer1726, 2019-02-09
@gomer1726

Or you can try this library if you have worked with Yii2 before

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question