public function routeAllToJsonrpc() { \App::before(function () { \Route::post('{all}', function ($path) { return \App::make('Leeb\\Jsonrpc\\Interfaces\\RouterInterface')->route(); })->where('all', '.*'); }); }
<?php /* * Register System routes before all user routes. */ App::before(function ($request) { /* * Combine JavaScript and StyleSheet assets */ Route::any('combine/{file}', 'System\\Classes\\Controller@combine'); });
/* |-------------------------------------------------------------------------- | 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) { try { $user = DB::table('users')->first(); unset($user); } catch (\PDOException $e) { if (!in_array($request->path(), array('install', 'install/db', 'install/api', 'install/user', 'install/complete'))) { return Redirect::to('/install', 302); } } }); App::after(function ($request, $response) { if (get_class($response) != 'Symfony\\Component\\HttpFoundation\\BinaryFileResponse') { $response->header('Cache-Control', 'no-cache, must-revalidate'); $response->header('P3P', 'CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); } }); App::missing(function ($exception) { Log::error('URL : ' . URL::current()); $error = new Andriynto\Ebri\Controllers\Error(); return $error->_404(); });
<?php /* |-------------------------------------------------------------------------- | 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) { if (Config::get('lanager/config.installed') !== true) { return 'Run <pre>php artisan lanager:install</pre> from the lanager/ directory before continuing'; } }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | CSRF Protection Filter |-------------------------------------------------------------------------- | | The CSRF filter is responsible for protecting your application against | cross-site request forgery attacks. If this special token in a user | session does not match the one given in this request, we'll bail. | */ Route::filter('csrf', function () {
<?php App::before(function ($request) { if (Session::has('client_ip')) { //check ip_address in blocking table $blocking = Blocking::where('ip_address', Session::get('client_ip'))->first(); if (!empty($blocking)) { if ($blocking->should_block_web_access) { return trans('msgs.you_dont_have_website_access'); } $path = $request->path(); if ($path == "login" && $blocking->should_block_login) { return trans('msgs.you_dont_have_login_access'); } if ($path == "customer/tickets" && $blocking->should_block_tickets) { return trans('msgs.you_dont_have_tickets_access'); } } } }); Route::filter('has_permission', function ($route, $request, $permission) { if (Auth::check()) { if (!\KodeInfo\Utilities\Utils::canViewBackend(Auth::user()->id)) { Auth::logout(); Session::flush(); Session::flash('error_msg', trans('msgs.access_denied_escalate_rights')); return Redirect::to('/login'); } if (!Permissions::hasPermission($permission)) { $permission_obj = Permissions::where('key', $permission)->pluck('text'); Session::flash('error_msg', trans('msgs.access_denied_escalate_rights', ['permission_obj' => $permission_obj]));
<?php /* |-------------------------------------------------------------------------- | 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) { // header("Access-Control-Allow-Origin: *"); }); App::after(function ($request, $response) { }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('www', function ($route, $request) { $host = $request->getHost(); $parts = explode('.', $host);
<?php /* |-------------------------------------------------------------------------- | 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) { View::share('isAjax', Request::Ajax()); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { if (Request::ajax()) {
<?php /** * Register Backend routes before all user routes. */ App::before(function ($request) { /* * Extensibility */ Event::fire('backend.beforeRoute'); /* * Other pages */ Route::group(['prefix' => Config::get('cms.backendUri', 'backend')], function () { Route::any('{slug}', 'Backend\\Classes\\BackendController@run')->where('slug', '(.*)?'); }); /* * Entry point */ Route::any(Config::get('cms.backendUri', 'backend'), 'Backend\\Classes\\BackendController@run'); /* * Extensibility */ Event::fire('backend.route'); });
/* |-------------------------------------------------------------------------- | 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 () { if (!Request::is('api/*')) { session_start(); if (in_array(BaseController::cookieGet('lang'), ['en', 'ru', 'by'])) { App::setLocale(BaseController::cookieGet('lang')); } if (!BaseController::sessionGet('token')) { BaseController::sessionSet('token', BaseController::randString(6)); } } }); App::after(function () { }); /* * Registration captcha check */ Route::filter('signup', function () { if (!BaseController::checkCaptcha()) { return View::make('verif.signup'); } });
| */ App::before(function ($request) { if (Auth::check()) { $count = Session::get(SESSION_COUNTER, 0); Session::put(SESSION_COUNTER, ++$count); } if (App::environment() == ENV_PRODUCTION) { if (!Request::secure()) { return Redirect::secure(Request::getRequestUri()); } } if (Input::has('lang')) { $locale = Input::get('lang'); App::setLocale($locale); Session::set(SESSION_LOCALE, $locale); if (Auth::check()) { if ($language = Language::whereLocale($locale)->first()) { $account = Auth::user()->account; $account->language_id = $language->id; $account->save(); } } } else { if (Auth::check()) { $locale = Session::get(SESSION_LOCALE, DEFAULT_LOCALE); App::setLocale($locale); } } }); App::after(function ($request, $response) { //
<?php /* |-------------------------------------------------------------------------- | 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) { //SiteHelpers::globalXssClean(); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { return Redirect::guest('user/login');
/* |-------------------------------------------------------------------------- | 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) { // Get default PHP locale $phpLocale = Config::get('app.phplocale'); // Check for session override if (Session::has('lang')) { App::setLocale(Session::get('lang')); $phpLocale = Session::get('locale'); } setlocale(LC_TIME, $phpLocale); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking.
<?php /* |-------------------------------------------------------------------------- | 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) { date_default_timezone_set('PRC'); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { if (Request::ajax()) {
| Language |-------------------------------------------------------------------------- | | Detect the browser language. | */ Route::filter('detectLang', function ($route, $request, $lang = 'auto') { if ($lang != "auto" && in_array($lang, Config::get('app.available_language'))) { Config::set('app.locale', $lang); } else { $browser_lang = !empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ',') : ''; $browser_lang = substr($browser_lang, 0, 2); $userLang = in_array($browser_lang, Config::get('app.available_language')) ? $browser_lang : Config::get('app.locale'); Config::set('app.locale', $userLang); App::setLocale($userLang); } }); /** * Enforce https. */ App::before(function ($request) { $settings = Config::get('app'); if ($settings['app_environment'] == 'production') { if (!Request::secure()) { return Redirect::secure(Request::path()); } } }); App::error(function (\Illuminate\Session\TokenMismatchException $exception) { return Redirect::route('login')->with('message', 'Your session has expired. Please try logging in again.'); });
App::before(function ($request) { Commoner::observe(); //change the hash so no malware uses it Config::set('cms.installation_hash', ''); $addonsNotInstalled = $addonsInstalled = $themesNotInstalled = $themesInstalled = array(); $addons = Addons::all(); $themes = Themes::all(); foreach ($addons as $addon) { if ($addon->installed == 1) { ClassLoader::addDirectories(array(public_path() . "/addons/{$addon->addon_name}/controllers", public_path() . "/addons/{$addon->addon_name}/models", public_path() . "/addons/{$addon->addon_name}/helpers")); } } foreach ($themes as $theme) { if ($theme->installed == 1) { $themesInstalled[] = $theme->theme_name; if ($theme->active == 1) { Config::set('cms.theme', $theme->theme_name); //include the functions file include_once public_path() . "/layouts/frontend/{$theme->theme_name}/func.php"; } } else { $themesNotInstalled[] = $theme->theme_name; } } $settings = Settings::whereRaw("autoload=1")->get(); $auto_settings = array(); foreach ($settings as $setting) { $auto_settings[$setting->area][$setting->section][$setting->setting_name] = $setting->setting_value; } Config::set("cms.auto_settings", $auto_settings); Config::set("cms.themes.data", $themes); Config::set("cms.themes.installed", $themesInstalled); Config::set("cms.themes.not_installed", $themesNotInstalled); foreach ($addons as $addon) { if ($addon->installed == 1) { $addonsInstalled[] = $addon->addon_name; if (file_exists(public_path() . "/addons/{$addon->addon_name}/routes.php")) { require public_path() . "/addons/{$addon->addon_name}/routes.php"; } if (file_exists(public_path() . "/addons/{$addon->addon_name}/func.php")) { require public_path() . "/addons/{$addon->addon_name}/func.php"; } $namespace = $addon->addon_name; $path = public_path() . "/addons/{$addon->addon_name}/lang"; Lang::addNamespace($namespace, $path); } else { $addonsNotInstalled[] = $addon->addon_name; } } Config::set("cms.addons.data", $addons); Config::set("cms.addons.installed", $addonsInstalled); Config::set("cms.addons.not_installed", $addonsNotInstalled); if (Session::has('currlang')) { Config::set('cms.currlang', Session::get('currlang')); } else { $lang = Languages::where("code", "=", Config::get('cms.currlang'))->first(); Config::set('cms.currlang', array('code' => $lang->code, 'title' => $lang->title, 'image' => $lang->image)); } });
<?php /* |-------------------------------------------------------------------------- | 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) { if (Request::getMethod() == "OPTIONS") { $headers = array('Access-Control-Allow-Methods' => 'POST, GET, OPTIONS, PUT, DELETE', 'Access-Control-Allow-Headers' => 'X-Requested-With, content-type'); return Response::make('', 200, $headers); } }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */
<?php /* |-------------------------------------------------------------------------- | 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) { header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, OPTIONS'); header('Access-Control-Allow-Headers: Origin, Content-Type, Accept, Authorization, X-Request-With'); header('Access-Control-Allow-Credentials: true'); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */
/* |-------------------------------------------------------------------------- | 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) { App::singleton('customURL', function () { //$customURL = 'http://kalugdanresort.com/public/'; $customURL = '/'; return $customURL; }); // If you use this line of code then it'll be available in any view // as $site_settings but you may also use app('site_settings') as well View::share('customURL', app('customURL')); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking.
<?php App::before(function () { //echo "<br>start<br>"; }); App::after(function () { //echo "<br>end<br>"; }); Route::filter('auth', function () { if (Auth::guest()) { Url::redirect("@login"); return false; } else { return true; } }); Route::filter('guest', function () { if (Auth::guest()) { Url::redirect('/'); } }); Route::filter('csrf', function () { if (Session::token() != Res::post('_token')) { return false; } else { return true; } });
<?php /* |-------------------------------------------------------------------------- | 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 () { $throttleProvider = Sentry::getThrottleProvider(); $throttleProvider->enable(); }); App::after(function () { if (Config::get('larapress.settings.log')) { Helpers::logPerformance(); } }); /* |-------------------------------------------------------------------------- | Special larapress Filters |-------------------------------------------------------------------------- | | The following filters are developed for larapress but may be also useful | for your website. You can apply them to any route you'd like. | */ Route::filter('force.human', 'Larapress\\Filters\\Special\\ForceHumanFilter');
/* |-------------------------------------------------------------------------- | 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) { $authzToken = new Airavata\Model\Security\AuthzToken(); $authzToken->accessToken = "emptyToken"; $apiVersion = Airavata::getAPIVersion($authzToken); if (empty($apiVersion)) { return View::make("server-down"); } else { Session::put('authz-token', $authzToken); } }); App::after(function ($request, $response) { // // Test commit. }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily
<?php /* |-------------------------------------------------------------------------- | 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) { // return 'test'; }); App::after(function ($request, $response) { // }); App::missing(function ($exception) { // Route::any('{?params}', function($params){ // return $params; // }); // return Response::view('errors.missing', array(), 404); // $a = Input::all(); // return "$_SERVER[REQUEST_URI]";; }); App::missing(function ($exception) { return Response::view('errors.404', array(), 404); }); /* |--------------------------------------------------------------------------
} } View::share('widgets', $widgets); if (Auth::check()) { View::share('userData', Auth::user()); } //Load custom email config from database CustomEmailSettings::loadEmailConfigFromDB(); //Activate notification system for edit list ViralList::observe(new \Notifications\EditListNotifier\EditListModelObserver()); //Activate notification system for list approval \Notifications\ApprovedListNotifier\ApprovedListNotificationEventHandler::enable(); }); //Getting Categories App::before(function ($request) { BaseController::loadCategories(); BaseController::setupShortCodes(); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () {
<?php App::before(function ($request) { $api_path = '/api/v1/'; $api_class = 'DLNLab\\Classified\\Classes'; Route::get($api_path . 's/{query}', $api_class . '\\RestAd@getSearch'); Route::get($api_path . 'ad/{id}/nearby', $api_class . '\\RestAd@getNearby'); Route::get($api_path . 'crawl/ad_deactive', $api_class . '\\RestCrawl@getAdDeactive'); Route::get($api_path . 'crawl/tag_count', $api_class . '\\RestCrawl@getRefreshTagCount'); Route::get($api_path . 'crawl/ad_share', $api_class . '\\RestCrawl@getAdShareCrawl'); Route::get($api_path . 'crawl/ad_share_count', $api_class . '\\RestCrawl@getAdShareCount'); //Route::post($api_path . 'crawl/ad_share_page_status', $api_class . '\RestCrawl@postAdShareStatusCrawl'); Route::get($api_path . 'login_fb', $api_class . '\\RestAccessToken@getAuthenticateFB'); Route::get($api_path . 'callback_fb', $api_class . '\\RestAccessToken@getCallbackFB'); Route::get($api_path . 'login_gp', $api_class . '\\RestAccessToken@getAuthenticateGPlus'); Route::get($api_path . 'callback_gp', $api_class . '\\RestAccessToken@getCallbackGP'); Route::post($api_path . 'post_fb', $api_class . '\\RestAccessToken@postFeedFB'); Route::get($api_path . 'update_page_access_token', $api_class . '\\RestAccessToken@getUpdatePageAccessTokenFB'); Route::post($api_path . 'login', $api_class . '\\RestAccount@postLogin'); }); Route::filter('auth', function () { if (!Auth::check()) { return Response::json(array('status' => 'error', 'message' => trans(CLF_LANG_MESSAGE . 'require_signin')), 500); } }); Route::filter('csrf', function () { $token = Request::ajax() ? Request::header('X-CSRF-Token') : Input::get('_token'); if (Session::token() != $token) { return Response::json(array('status' => 'error', 'message' => trans(CLF_LANG_MESSAGE . 'not_valid')), 500); } });
| The CSRF filter is responsible for protecting your application against | cross-site request forgery attacks. If this special token in a user | session does not match the one given in this request, we'll bail. | */ Route::filter('csrf', function () { if (Session::token() != Input::get('_token')) { throw new Illuminate\Session\TokenMismatchException(); } }); /* |-------------------------------------------------------------------------- | DEV mode |-------------------------------------------------------------------------- | | Sometimes you don’t want to allow any content coming out of | Laravel to be cached. | */ App::before(function ($request) { // Clear view cache in local (only) with every request if (App::environment() == 'local') { $cachedViewsDirectory = app('path.storage') . '/views/'; $files = glob($cachedViewsDirectory . '*'); foreach ($files as $file) { if (is_file($file)) { @unlink($file); } } } });
App::before(function ($request) { if (Request::is('admin/*')) { return; } $root = \Cache::tags(array('jarboe', 'j_tree'))->get('j_tree'); $current = null; foreach ($root as $child) { if (Request::is(App::getLocale() . '/' . $child->getUrl()) || Request::is($child->getUrl())) { $current = $child; } } $footerMenu = array(); foreach ($root as $node) { if ($node->isFooterMenu()) { $footerMenu[] = array('url' => $node->getUrl(), 'title' => $node->t('title')); } } Collector::set('footerMenu', $footerMenu); Collector::set('flatRoot', $root); $root = $root->toHierarchy(); Collector::set('root', $root); Collector::set('current', $current); // breadcrumbs and links relations if (isset($current) && isset($current->id)) { $breadcrumbsEntity = Cache::tags('j_tree')->rememberForever('breadcrumbs_' . $current->id . '_' . App::getLocale(), function () use($current) { return new Breadcrumbs($current); }); Collector::set('breadcrumbs', $breadcrumbsEntity); $links = Cache::tags('j_tree', 'breadcrumb_links2tb_tree')->rememberForever('breadcrumb_links2tb_tree_' . $current->id . '_' . App::getLocale(), function () use($current) { $relatedLinksIds = DB::table('breadcrumb_links2tb_tree')->where('id_node', $current->id)->lists('id_link'); if ($relatedLinksIds) { return BreadcrumbLink::whereIn('id', $relatedLinksIds)->get(); } return false; }); Collector::set('breadcrumb_links', $links); } $calculatorsSettingsAll = Cache::tags('calculator_settings')->rememberForever('calculator_settings', function () { return CalculatorSetting::all(); }); $calculatorsSettings = array(); foreach ($calculatorsSettingsAll as $calculatorsSetting) { $calculatorsSettings[$calculatorsSetting->type][$calculatorsSetting->name] = $calculatorsSetting->value; } // supahacks Collector::set('idNewsCatalog', 964); Collector::set('idSmallBusinessCategory', array(4)); Collector::set('idCorporateBusinessCategory', array(2)); Collector::set('idInvestorRelationsCategory', array(7)); Collector::set('idAboutAchievements', 1179); Collector::set('idSmallBusinessDeposits', 45); Collector::set('idDepositsCatalog', 210); Collector::set('idCardsCatalog', 18); Collector::set('calculatorsSettings', $calculatorsSettings); // translates $translator = \Yaro\Jarboe\Helpers\Translate::getInstance(); Collector::set('translates', $translator->getAllStatic()); });
<?php /* |-------------------------------------------------------------------------- | 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) { //Lang::setLocale(Session::get('locale')); if (Session::has('locale')) { Lang::setLocale(Session::get('locale')); } else { Session::put('locale', Config::get('app.locale')); } }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. |
/* |-------------------------------------------------------------------------- | 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) { //detr : set session ngôn ngữ if (!Session::has('langs_detr')) { Session::put('langs_detr', 'vi'); } header("Access-Control-Allow-Origin: http://inqua.vn/"); header('Access-Control-Allow-Methods : GET, POST, OPTIONS'); header('Access-Control-Allow-Headers : Origin, X-Requested-With, Content-Type, Accept'); header('Access-Control-Allow-Credentials : true'); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking.
<?php /* |-------------------------------------------------------------------------- | 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) { // }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { if (Request::ajax()) {
<?php /* |-------------------------------------------------------------------------- | 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) { Request::setTrustedProxies([$request->getClientIP()]); }); App::after(function ($request, $response) { // }); /* |-------------------------------------------------------------------------- | Authentication Filters |-------------------------------------------------------------------------- | | The following filters are used to verify that the user of the current | session is logged into this application. The "basic" filter easily | integrates HTTP Basic authentication for quick, simple checking. | */ Route::filter('auth', function () { if (Auth::guest()) { return Redirect::to('user/login');