Beispiel #1
0
 |--------------------------------------------------------------------------
 | Application & Route Filters
 |--------------------------------------------------------------------------
 |
 | Below you will find the "before" and "after" events for the application
 | which may be used to do any work before or after a request into your
 | application. Here you may also register your custom route filters.
 |
*/
App::before(function ($request) {
    Event::fire('clockwork.controller.start');
    /**
     * A láblévben megjelenő cikkek objektumát hozza létre.
     */
    if (!Request::is('admin') && !Request::is('admin/*')) {
        View::share('articleFooter', \Divide\CMS\Article::orderBy('created_at', 'desc')->take('3')->get(['id', 'title', 'author_id', 'created_at']));
    }
    /**
     * A felhasználó objektumát hozza létre!.
     */
    if ((Request::is('admin') || Request::is('admin/*')) && Sentry::check()) {
        View::share('user', \Divide\CMS\User::find(\Sentry::getUser()->id));
    }
    /* if(Request::path()!='/')
       {
       return Redirect::to('/');
       } */
    /* if( ! Request::secure() && FALSE)
       {
       return Redirect::secure(Request::path());
       } */