public function __construct()
 {
     View::make('coaster::asset_builder.main')->render();
     $this->layout = 'coaster::template.main';
     $this->layoutData = ['site_name' => config('coaster::site.name'), 'title' => '', 'system_menu' => '', 'sections_menu' => '', 'modals' => '', 'content' => '', 'coaster_routes' => Routes::jsonRoutes()];
     $currentRouteName = Request::route()->getName();
     $installRoute = Install::getRedirectRoute();
     if (strpos($currentRouteName, $installRoute) !== 0) {
         \redirect()->route($installRoute)->send();
         exit;
     }
 }
Пример #2
0
 /**
  * @param string $method
  * @param array $parameters
  * @return \Illuminate\Contracts\View\View
  */
 public function callAction($method, $parameters)
 {
     $altResponseContent = parent::callAction($method, $parameters);
     if (is_null($altResponseContent)) {
         $this->layoutData = array_merge(['system_menu' => AdminMenu::getSystemMenu(), 'sections_menu' => Auth::admin() ? AdminMenu::getSectionsMenu() : '', 'coaster_routes' => Routes::jsonRoutes()], $this->layoutData);
     }
     event(new LoadResponse($this->layout, $this->layoutData, $altResponseContent, $this->responseCode));
     if (is_a($altResponseContent, \Symfony\Component\HttpFoundation\Response::class)) {
         return $altResponseContent;
     } else {
         $responseContent = is_null($altResponseContent) ? View::make($this->layout, $this->layoutData) : $altResponseContent;
     }
     return Response::make($responseContent, $this->responseCode);
 }