-
-
Notifications
You must be signed in to change notification settings - Fork 9
Add findOrFail #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add findOrFail #11
Conversation
freekmurze
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
| return new static("Could not find a prefixed model `{$prefixedId}`"); | ||
| } | ||
|
|
||
| public function getSolution(): Solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
I'm thinking it might be better to throw Laravel's ModelNotFoundException, as this gets handled into a 404 correctly by default in Laravel. throw (new ModelNotFoundException())->setModel(static::class);What do you think @freekmurze? |
|
@riasvdv I was using Wouldn't it be possible to extend This would make it possible to listen for both exceptions, right? :) |
|
Thanks! |
|
@freekmurze Thanks for the merge. :) |
No description provided.