laravel 5.1: How to share a collection in all views?
You can share View Data between all views. Just add this one line to the boot()
method in App\Providers\AppServiceProvider
:
view()->share('news', NewsStory::orderBy('created_at', 'desc')->paginate(5));