Great call! A little extra code, but you can definitely get it working.
Joe Tannenbaum

I got this working nicely by doing my bindings like this:

Route::bind('photo', [Hasher::class, 'decode']);

Which leaves the ORM to Laravel like usual, thus returning the same 404 error if the ID is invalid.

Plus, it’s a one-line solution, much cleaner to just put this line after your Route::resource() call.

Like what you read? Give Jake Taylor a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.