Example #1
0
 /**
  * Bind data to the view.
  *
  * @param \Illuminate\Contracts\View\View $view
  */
 public function compose(View $view)
 {
     $view->withThemeBackgroundColor(Setting::get('style_background_color'));
     $view->withThemeTextColor(Setting::get('style_text_color'));
     $viewData = $view->getData();
     $themeView = array_only($viewData, preg_grep('/^theme/', array_keys($viewData)));
     $hasThemeSettings = array_filter($themeView, function ($data) {
         return $data != null;
     });
     $view->withThemeSetup(!empty($hasThemeSettings));
 }