Laravel 5+ How to make dynamic menus

1

My question is how to make dynamic menus in Laravel, which should appear in all views.

The menu should leave the categories table, and I can cache it so that the query does not repeat unnecessary times.

But how do I get it to appear in all views (especially in my file sidebar.blade.php )

If it were that I need it in a single view it would be simple.

Greetings and Thanks

    
asked by user3123766 24.06.2018 в 18:55
source

1 answer

0

You can create a file mostrarCategoria.blade.php or whatever you want to call it and there you put the logic to print the categories then just include that file where you need to show the categories.

In your file sidebar.blade.php

You would put the following line

@include('mostrarCategoria.blade.php')

I hope you serve or help, greetings

    
answered by 25.06.2018 в 00:03