How to create a database-driven multi-level navigation menu using Laravel

前端 未结 3 956
情歌与酒
情歌与酒 2020-12-02 15:06

I\'m new to Laravel 4 and I\'m totally confused about it\'s models. I\'m trying to create a database-driven navigation menu for my project and all I know is I have to create

3条回答
  •  忘掉有多难
    2020-12-02 15:43

    For those like me visiting this article nearly 4 years later, I would say the new best solution is all in this video:

    https://laracasts.com/series/laravel-5-fundamentals/episodes/25

    View Composers

    https://laravel.com/docs/5.4/views#view-composers

    View composers are callbacks or class methods that are called when a view is rendered. If you have data that you want to be bound to a view each time that view is rendered, a view composer can help you organize that logic into a single location.

提交回复
热议问题