Пример #1
0
Route::filter('setP3PHeader', function ($route, $request, $response) {
    if (method_exists($response, "header")) {
        $response->header("P3P", 'CP="Clifford"');
    }
});
/*
|--------------------------------------------------------------------------
| "Live Check" Filter
|--------------------------------------------------------------------------
|
| Returns the maintenance response if the site should not be live at the
| moment for some reason.
|
*/
Route::filter('liveCheck', function () {
    if (!DebugHelpers::shouldSiteBeLive()) {
        return DebugHelpers::generateMaintenanceModeResponse();
    }
});
/*
|--------------------------------------------------------------------------
| "Api Enabled Check" Filter
|--------------------------------------------------------------------------
|
| Returns a service unavailable response if the api is disabled.
|
*/
Route::filter('apiEnabledCheck', function () {
    if (!Config::get("api.enabled")) {
        return App::make('uk\\co\\la1tv\\website\\controllers\\api\\ApiBaseController')->callAction("respondWithServiceUnavalable", array());
    }