Skip to content

Conversation

iliyaZelenko
Copy link

@iliyaZelenko iliyaZelenko commented Sep 18, 2018

This solves the problem with API 404 response.

If you put the following code in routes/api.php it does not work:

Route::fallback(function() {
    return response()->json(['message' => 'Not Found!'], 404);
});

If no route is found, then there is the possibility to return an 404 error.

https://stackoverflow.com/q/52382680/5286034

This solves the problem with

Route::fallback(function() {
    return response()->json(['message' => 'Not Found!'], 404);
});

If no route is found, then there is the possibility to return an 404 error.

https://stackoverflow.com/q/52382680/5286034
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant