Support the ongoing development of Laravel.io →
Requests Eloquent Blade
Last updated 2 years ago.
0

I have solved this by following this excellent tutorial

https://scotch.io/tutorials/sharing-data-between-views-using-laravel-view-composers

if pulling data from the db you can add the view composer to the boot method on the ComposerServiceMethod

View::composer('*', function($view)
{
$view->with('categories', Categories::where('parent_id',NULL)->orderBy('id')->get());
});
0

Sign in to participate in this thread!

Eventy

Your banner here too?

thomas159 thomas159 Joined 16 Oct 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.