Support the ongoing development of Laravel.io →
Eloquent Laravel
Last updated by @b-pfl 1 year ago.
0
moderator

If you use the message I suspect that you see it in the browser as a view. I think the best solution then is to use a custom error page.

See the documentation: https://laravel.com/docs/9.x/errors#custom-http-error-pages

I think you can use this code in your blade if you need to model name:

// the 404 page is from a NotFoundHttpException
// that has the ModelNotFoundException as previous
<h2>Model: {{ $exception->getPrevious()->getModel() }}</h2>
0

Sign in to participate in this thread!

Eventy

Your banner here too?

B b-pfl Joined 16 Feb 2022

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.