Hello @clakey
try this,
// You can keep this in your filters.php file
App::before(function($request) {
App::singleton('site_settings', function(){
$site_settings = Setting::all();
return $site_settings;
});
// If you use this line of code then it'll be available in any view
// as $site_settings but you may also use app('site_settings') as well
View::share('site_settings', app('site_settings'));
});
To get the same data in any controller you may use:
$site_settings = app('site_settings');
Thanks for your reply, but I think your code may be written for Laravel 4.x, when I am using Laravel 5!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community