add model,controller,migration,api

This commit is contained in:
Nazri Hamzah
2018-04-27 18:03:16 +08:00
parent 7b4e76b39e
commit 805d357048
43 changed files with 3254 additions and 167 deletions
+8
View File
@@ -48,6 +48,14 @@ class Handler extends ExceptionHandler
*/
public function render($request, Exception $exception)
{
// This will replace our 404 response with
// a JSON response.
if ($exception instanceof ModelNotFoundException) {
return response()->json([
'error' => 'Resource not found'
], 404);
}
return parent::render($request, $exception);
}
}