Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Move API fallback to BasicApiController
Browse files Browse the repository at this point in the history
  • Loading branch information
miyacorata committed Apr 29, 2020
1 parent 855fddc commit 2d73cb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 8 additions & 0 deletions app/Http/Controllers/Api/v1/BasicApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,12 @@ public function status(){
$return['birthday'] = getIdolByBirthdate();
return response()->json($return);
}

public function routeFallback(){
return response()->json(['error' => [
'status' => 404,
'error' => 'Not Found',
'message' => 'There is nothing here.'
]],404);
}
}
8 changes: 1 addition & 7 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
Route::get('status','BasicApiController@status');
});

Route::fallback(function (){
return response()->json(['error' => [
'status' => 404,
'error' => 'Not Found',
'message' => 'There is nothing here.'
]],404);
});
Route::fallback('Api\v1\BasicApiController@routeFallback');
});

0 comments on commit 2d73cb0

Please sign in to comment.