Example #1
0
 public function __construct()
 {
     parent::__construct();
     $this->middleware('permissions', array('except' => 'anyLogin'));
     //dd(\URL::current());
     //    $this->beforeFilter('permission:'.\Route::currentRouteAction().','.$string, array('except'=>'anyLogin'));
     //
     $this->applications = \Application::with('url')->get();
     view()->share('applications', $this->applications);
     //we need to register the package we are using:
 }
Example #2
0
 /**
  * Test handler
  * @param  [type]  $request [description]
  * @param  Closure $next    [description]
  * @return [type]           [description]
  */
 public function handle($request, Closure $next)
 {
     //try and pick app from session, if visiting cms
     if (($request->is(rtrim(config('bootlegcms.cms_route'), '/')) || $request->is(config('bootlegcms.cms_route') . '*')) && !$request->is(config('bootlegcms.cms_route') . 'login')) {
         $cms_app = \Session::get('cms_app');
         if ($cms_app) {
             $application = \Application::with('setting', 'languages', 'plugins')->find($cms_app);
         }
     }
     if (@$application) {
         $GLOBALS['application'] = serialize($application);
     }
     return $next($request);
 }