public function composerSeo() { view()->composer('common.seo', function ($view) { $path = Request::path(); $seos = SeoInfo::seoMap(); $seo; if (starts_with($path, 'notes')) { $seo = $seos['notes']; } else { if (starts_with($path, 'guide')) { $seo = $seos['guide']; } else { if (starts_with($path, 'activity')) { $seo = $seos['activity']; } else { $seo = $seos['index']; } } } return $view->with('seo', $seo); }); }
/** * Bootstrap any application services. * * @return void */ public function boot() { view()->share('seos', SeoInfo::seoMap()); }