mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Add fallback route to catch all non existant routes
This commit is contained in:
parent
44c987fd41
commit
e95558334e
@ -34,6 +34,16 @@ class BaseController extends Controller
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Catch all fallback route
|
||||
* for non-existant route
|
||||
*/
|
||||
public function notFound()
|
||||
{
|
||||
return response()->json([
|
||||
'message' => 'Nothing to see here!'], 404);
|
||||
}
|
||||
|
||||
protected function errorResponse($response, $httpErrorCode = 400)
|
||||
{
|
||||
$error['error'] = $response;
|
||||
|
@ -58,11 +58,11 @@ class ClientController extends BaseController
|
||||
*/
|
||||
public function index(ClientFilters $filters)
|
||||
{
|
||||
|
||||
$clients = Client::filter($filters);
|
||||
|
||||
return $this->listResponse($clients);
|
||||
|
||||
// return response()->json($clients);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -65,4 +65,7 @@ Route::group(['middleware' => ['db','api_secret_check','token_auth']], function
|
||||
|
||||
Route::get('settings', 'SettingsController@index')->name('user.settings');
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Route::fallback('BaseController@notFound');
|
Loading…
x
Reference in New Issue
Block a user