Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { $ip = Request::getClientIp(); $whitelist = array("173.13.187.110"); if (!in_array($ip, $whitelist)) { return Response::view('maintenance', array(), 403); } }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; /*
} die($response); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { if (!empty($_COOKIE['dev'])) { return NULL; } return Response::view('maintenance', array(), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/composers.php'; require app_path() . '/lib/helpers/translate.php';
| us to have error handling setup before we boot our application. | */ require __DIR__ . '/errors.php'; /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return show_error_page(503); }); /* |-------------------------------------------------------------------------- | Require The Functions File |-------------------------------------------------------------------------- | | We will require a file which you can define any custom functions for | your application, before any usage of these functions occurs. This | is just a convenient way to organize your code. | */ require app_path() . '/functions.php'; /* |-------------------------------------------------------------------------- | Require The Hooks File
/*App::missing(function($exception) { return Response::view('errorpages.404', array(), 404); });*/ /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::view('errors.maintenance'); }); App::bind('TaskInterface', function () { return new TaskRepository(); }); App::bind('ProjectInterface', function () { return new ProjectRepository(); }); App::bind('CalendarInterface', function () { return new CalendarRepository(); }); App::bind('TimesheetInterface', function () { return new TimesheetRepository(); }); App::bind('TodoInterface', function () { return new TodoRepository();
| shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('public.maintenance', array(), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/blade.php';
case 500: return Response::make(View::make('error/500'), 500); default: return Response::make(View::make('error/404'), 404); } } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::make(View::make('error/503'), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
| shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { Log::error($exception); return Response::make("Sistem ini sedang dikemaskini. Harap Maaf.", 404); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("Sistem Dalam Selenggaraan!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
App::down(function () { // Get Path Info $pathInfo = trim(currentPathInfo(), "/"); // Allowed $allowed = false; // Check for Login Page if (currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::loginRoute(), \Developeryamhi\AuthModule\UserItem::loginRouteParams()) || currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::logoutRoute(), \Developeryamhi\AuthModule\UserItem::logoutRouteParams())) { $allowed = true; } // Check for User if (!$allowed && Auth::check() && Auth::user()->canAccess("maintainance_mode")) { $allowed = true; } // Get IPs if Setting Created $maintainance_ip_use_as = getSetting("maintainance_ip_use_as"); $maintainance_ips = getSetting("maintainance_ips"); // Check if Setting is Valid if ($maintainance_ip_use_as && $maintainance_ips && !empty($maintainance_ips)) { // IP List $ip_list = explode("\r\n", $maintainance_ips); // Current Visitor IP $currentIP = Request::getClientIp(); // Found $found = in_array($currentIP, $ip_list); // Check Found if ($found && $maintainance_ip_use_as == "whitelist") { $allowed = true; } else { if (!$found && $maintainance_ip_use_as == "whitelist") { $allowed = false; } else { if ($found && $maintainance_ip_use_as == "blacklist") { $allowed = false; } else { if (!$found && $maintainance_ip_use_as == "blacklist") { $allowed = true; } } } } } // Check for Scripts, Styles & Images if (!$allowed && (in_array(substr($pathInfo, -3), array(".js")) || in_array(substr($pathInfo, -4), array(".css", ".jpg", ".png")))) { // Set Allowed $allowed = true; } // Check Allowed if (!$allowed) { return Response::view("laravel-admin::maintainance", array("errorTitle" => "System Undergoing Changes"), 503); } });
Route::get('/galerias', ['as' => 'galleries', 'uses' => 'GalleryController@index']); Route::get('/galeria/{slug}/{id}', ['as' => 'gallery', 'uses' => 'GalleryController@show']); // Plana Aadministrativa route::get('/plana-administrativa', ['as' => 'leadership', 'uses' => 'LeaderShipController@index']); // Incotec route::get('/incotec', ['as' => 'incotec', 'uses' => 'IncotecController@index']); // Contacto Route::get('/contacto', ['as' => 'contact', 'uses' => 'ContactController@index']); Route::post('/contacto', ['as' => 'contact_store', 'before' => 'csrf', 'uses' => 'ContactController@store']); // Login Route::post('/login', ['as' => 'login', 'before' => 'csrf', 'uses' => 'AuthController@postLogin']); Route::get('/logout', ['as' => 'logout', 'before' => 'auth', 'uses' => 'AuthController@logout']); Route::group(['before' => 'guest'], function () { Route::get('/login', ['as' => 'login', 'uses' => 'AuthController@showLogin']); Route::get('/forgot-password', ['as' => 'forgot', 'uses' => 'AuthController@getForgotPassword']); Route::post('/forgot-password', ['as' => 'forgot-post', 'uses' => 'AuthController@postForgotPassword']); Route::get('/recover/{code}', ['as' => 'account-recover', 'uses' => 'AuthController@getRecover']); }); Route::group(['before' => 'auth'], function () { require __DIR__ . '/routes/auth.php'; Route::group(['before' => 'is_admin'], function () { require __DIR__ . '/routes/admin.php'; }); }); App::missing(function ($exception) { return Redirect::route('error_404'); }); // mantenimiento App::down(function () { return Redirect::route('error_503'); });
App::error(function (Exception $exception, $code) { Log::error($exception); }); App::error(function (Illuminate\Session\TokenMismatchException $exception) { return Response::make("CSRF error.", 500); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return DebugHelpers::generateMaintenanceModeResponse(); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/events.php';
<?php /* GLOBAL PATTERN ==========================================*/ App::down(function () { return "Maintaining"; }); Route::pattern('id', '\\d+'); Route::pattern('username', '[a-z0-9_.]+'); Route::pattern('slug', '[a-zA-Z0-9-]+'); /* END GLOBAL PATTERN ==========================================*/ /* BACKEND ROUTES ==========================================*/ /* * Logged routes without permission */ Route::group(array('before' => 'basicAuth', 'prefix' => Config::get('backend.uri')), function () { Route::get('advertiser-manager', array('as' => 'AdvertiserManagerIndex', 'uses' => 'AdvertiserManagerController@index')); Route::get('advertiser-manager/dashboard', array('as' => 'AdvertiserManagerDashboard', 'uses' => 'DashboardAdvertiserManagerController@showIndex')); Route::get('advertiser-manager/logout', array('as' => 'AdvertiserManagerLogout', 'uses' => 'AdvertiserManagerController@logout')); Route::get('advertiser-manager/access-denied', array('as' => 'AdvertiserManagerAccessDenied', 'uses' => 'AdvertiserManagerController@getAccessDenied')); Route::get('advertiser', array('as' => 'AdvertiserIndex', 'uses' => 'AdvertiserController@index')); Route::get('advertiser/dashboard', array('as' => 'AdvertiserDashboard', 'uses' => 'DashboardAdvertiserController@showIndex')); Route::get('advertiser/logout', array('as' => 'AdvertiserLogout', 'uses' => 'AdvertiserController@logout')); Route::get('advertiser/access-denied', array('as' => 'AdvertiserAccessDenied', 'uses' => 'AdvertiserController@getAccessDenied')); Route::get('publisher-manager', array('as' => 'PublisherManagerIndex', 'uses' => 'PublisherManagerController@index')); Route::get('publisher-manager/approve', array('as' => 'PublisherManagerDashboard', 'uses' => 'ApprovePublisherManagerController@showList')); Route::post('publisher-manager/show-list', array('as' => 'PublisherManagershowListDashboard', 'uses' => 'DashboardPublisherManagerController@showListDashboard')); Route::get('publisher-manager/logout', array('as' => 'PublisherManagerLogout', 'uses' => 'PublisherManagerController@logout')); Route::get('publisher-manager/access-denied', array('as' => 'PublisherManagerAccessDenied', 'uses' => 'PublisherManagerController@getAccessDenied'));
| */ App::error(function (Exception $exception, $code) { Log::error($exception); $message = $exception->getMessage(); return json_encode(array('error' => array('code' => $code, 'message' => empty($message) ? 'The resource or path you are looking for does not exist.' : $message, 'file' => $exception->getFile(), 'line' => $exception->getLine()))); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return json_encode(array('error' => array('code' => '503', 'message' => 'Sorry, server is in maintenance.'))); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
*/ App::error(function (Exception $exception, $code) { Log::error($exception); if (!Config::get('app.debug')) { return Response::view('notifications.500', array(), 500); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::view('notifications.maintenance', array(), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
return Response::view('errors.default', array(), $code); } } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("We are down for maintenance!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; /* |-------------------------------------------------------------------------- | Macro for the menu items active states
| shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { // Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return View::make('system.down'); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/events.php';
// }); } App::missing(function ($exception) { Log::warning($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("Estaremos pronto de vuelta!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/events.php'; include app_path() . '/libs/macros/macros.php';
return Response::view('system.notfound', [], 404); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { $clientIp = $_SERVER['REMOTE_ADDR']; $whitelist = getenv('IP_WHITELIST') !== false ? explode('|', getenv('IP_WHITELIST')) : []; if (!in_array($clientIp, $whitelist)) { return Response::view('system.maintenance', [], 503); } View::share('appdown', true); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/bfacp/macros.php';
try { $nro_persona = Auth::user()->nro_persona; } catch (Exception $e) { $nro_persona = 'no disponible'; } Log::error("[código:{$code}][ip:{$ip}][persona:{$nro_persona}]\n" . $exception->getMessage()); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("El sitio se encuentra en mantenimiento.<hr>Intente ingresar más tarde", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
return Api::error(Lang::get('errors.404'), 404); } return Response::view('errors.404', array(), 404); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { if (Request::is('api/*')) { return Api::error(Lang::get('errors.503'), 503); } return Response::view('errors.maint', array(), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
| exceptions. If nothing is returned, the default error view is | shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("<h2><center>Application is in maintenance mode</center></h2>", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
| exceptions. If nothing is returned, the default error view is | shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('maintenance', ['title' => 'Maintenance'], 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
if (Config::get('app.debug') == false) { return Response::view('pages.error', array('code' => $code), $code); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('pages.maintenance', ['time' => Config::get('larabase.maintenance_time')], 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; /* |-------------------------------------------------------------------------- | LaraBase
return Response::json(["url" => $url]); } else { return Redirect::to($url); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return osu_error(503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php'; require app_path() . '/start/osu.php'; require app_path() . '/html_macros.php';
default: return Response::view('error/404', array(), $code); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::make("西贝貌似采取措施了,我找时间看看", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require __DIR__ . '/../filters.php'; # Util Methods function d($var, $detail = null) {
// case 500: // return Response::view('errors.500', array(), 500); // default: // return Response::view('errors.default', array(), $code); // } Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenace mode is in effect for this application. | */ App::down(function () { return Response::make("Trang web đang bảo trì, xin vui lòng quay lại sau!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
}); App::fatal(function (Exception $exception) { Log::error($exception); if (!Config::get('app.debug') && !App::runningInConsole()) { return Response::view('errors.500', array('code' => 'Fatal', 'exception' => $exception), 500); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('errors.503', array(), 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
}); App::missing(function (Exception $exception) { return BaseController::error(Config::get('response.method.code'), Config::get('response.method.http'), 'Method not found'); }); App::error(function (Viper\Exception $exception) { return BaseController::error($exception->getCode(), $exception->getStatusCode(), $exception->getMessage()); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return BaseController::error(Config::get('response.unavailable.code'), Config::get('response.unavailable.http'), 'Be right back'); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
if (App::environment('production')) { return Response::view('errors.500', array(), 500); } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('pages.down', [], 503); }); /* |-------------------------------------------------------------------------- | Page Not Found Handler |-------------------------------------------------------------------------- */ App::missing(function () { return Response::view('errors.404', array(), 404); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us
| exceptions. If nothing is returned, the default error view is | shown, which includes a detailed stack trace during debug. | */ App::error(function (Exception $exception, $code) { Log::error($exception); }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::make("Be right back!", 503); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter | definitions instead of putting them all in the main routes file. | */ require app_path() . '/filters.php';
return Response::json(['error' => $exception->getMessage()], $exception->getCode()); break; } }); /* |-------------------------------------------------------------------------- | Maintenance Mode Handler |-------------------------------------------------------------------------- | | The "down" Artisan command gives you the ability to put an application | into maintenance mode. Here, you will define what is displayed back | to the user if maintenance mode is in effect for the application. | */ App::down(function () { return Response::view('page.system.maintenance', ['sections' => []], 503); }); App::missing(function (Exception $exception) { if (Request::is('*/.json')) { return Response::json(['error' => 'not found'], 404); } $section = new Section(); return View::make('page.system.404', ['message' => $exception->getMessage(), 'sections' => $section->get()]); }); /* |-------------------------------------------------------------------------- | Require The Filters File |-------------------------------------------------------------------------- | | Next we will load the filters file for the application. This gives us | a nice separate location to store our route and application filter