Skip to content

Misc Features

Max edited this page Sep 27, 2018 · 3 revisions

Eloquent's findOrFail() returns 404 on model not found

Eloquent's findOrFail() functions will result in an http 500 response if the model is not found. Through the RestfulModel class of the boilerplate, it's eloquent builder extends the findOrFail function to catch that exception and re-throw it as an NotFoundHttpException, leading to a more correct http 404 response.

Clone this wiki locally