diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index cf673829..36e12b99 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -35,6 +35,12 @@ class Controller extends BaseController { View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/')); View::share('imgBase', env('IMAGE_BASE_URL', '/')); + + $blogs = $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1); + $activeBlog = count($blogs) && $blogs[0]->is_active ? $blogs[0] : null; + View::share('activeBlog', $activeBlog); + + //View::share('onAir', file_get_contents(url('onair'))); View::composer('widgets.laatstenieuws', function($view) { $view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')); @@ -77,7 +83,6 @@ class Controller extends BaseController }); View::composer('widgets.menu', function($view) { $view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')) - ->with('blogs', $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1)) ->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\Model\NewsItem', 3)) ->with('podcasts', $this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')); }); diff --git a/resources/views/layouts/master.blade.php b/resources/views/layouts/master.blade.php index 68a0017f..fd024432 100644 --- a/resources/views/layouts/master.blade.php +++ b/resources/views/layouts/master.blade.php @@ -261,6 +261,12 @@
+ Live-blog: {{$activeBlog->title}} + Volg het live-blog +
+ @endif @yield('page')