Beispiel #1
0
        if (!Config::get('app.debug')) {
            if (Request::ajax() || Request::is('api/*')) {
                return MainHelper::response(null, $exception->getMessage(), 'error', 500);
            } else {
                View::share('page_title', 'Fatal Error');
                return Response::view('system.error', compact('exception', 'code'), 500);
            }
        }
        if (Request::is('api/*')) {
            return MainHelper::response([['message' => $exception->getMessage(), 'line' => $exception->getLine(), 'file' => $exception->getFile()]], 'Fatal Error', 'error', 500);
        }
    }
});
App::missing(function () {
    if (Request::is('api/*')) {
        return MainHelper::response(null, 'Resource Not Found', 'error', 404);
    }
    View::share('page_title', 'Page Not Found');
    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 () {
Beispiel #2
0
         Route::get('{player}/overview', ['as' => 'api.battlelog.players.overview', function (BFACP\Battlefield\Player $player) {
             $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]);
             return MainHelper::response($battlelog->getOverviewStats(), null, null, null, false, true);
         }])->where('player', '[0-9]+');
         Route::get('{player}/vehicles', ['as' => 'api.battlelog.players.vehicles', function (BFACP\Battlefield\Player $player) {
             $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]);
             return MainHelper::response($battlelog->getVehicleStats(), null, null, null, false, true);
         }])->where('player', '[0-9]+');
         Route::get('{player}/reports', ['as' => 'api.battlelog.players.reports', function (BFACP\Battlefield\Player $player) {
             $battlelog = App::make('BFACP\\Libraries\\Battlelog\\BPlayer', [$player]);
             return MainHelper::response($battlelog->getBattleReports(), null, null, null, false, true);
         }])->where('player', '[0-9]+');
         Route::get('{player}/acs', ['as' => 'api.battlelog.players.acs', function (BFACP\Battlefield\Player $player) {
             $acs = App::make('BFACP\\Libraries\\AntiCheat', [$player]);
             $data = $acs->parse($acs->battlelog->getWeaponStats())->get();
             return MainHelper::response($data, null, null, null, false, true);
         }])->where('player', '[0-9]+');
     });
 });
 /*================================
   =            API Bans            =
   ================================*/
 Route::group(['prefix' => 'bans'], function () {
     Route::get('latest', ['as' => 'api.bans.latest', 'uses' => 'BansController@latest']);
     Route::get('stats', ['as' => 'api.bans.stats', 'uses' => 'BansController@stats']);
     Route::group(['prefix' => 'metabans'], function () {
         Route::get('/', ['as' => 'api.bans.metabans.index', 'uses' => 'MetabansController@getIndex']);
         Route::get('feed', ['as' => 'api.bans.metabans.feed', 'uses' => 'MetabansController@getFeed']);
         Route::get('assessments', ['as' => 'api.bans.metabans.assessments', 'uses' => 'MetabansController@getAssessments']);
         Route::get('feed_assessments', ['as' => 'api.bans.metabans.feed_assessments', 'uses' => 'MetabansController@getFeedAssessments']);
     });