/** * Injects data from config into the current view * * @param Illuminate\View\View $view * @return void */ public function compose($view) { if (!self::$loadMultipleTimes && !self::$firstView) { return; } $viewData = $view->getData(); $viewName = $view->getName(); $vars = $this->getVars($viewName); if (count($vars)) { $this->DataBuilder->setData($viewData); $data = $this->DataBuilder->compile($vars); foreach ($data as $varName => $value) { $view->with($varName, $value); } } self::$firstView = false; }