Skip to content
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

[6.x] Implement findOrFail methods on repositories #990

Merged
merged 9 commits into from Feb 11, 2024

Conversation

duncanmcclean
Copy link
Owner

This pull request makes two changes to the find methods in Simple Commerce's repositories:

  • When using find, if an entry/model can't be found, null will be returned instead of an exception.
  • Added a new findOrFail method, which does the same as find, however instead of returning null when an entry/model can't be found, it'll return an exception.

This brings things inline with Laravel and soon Statamic Core.

Fixes #988.

@duncanmcclean duncanmcclean merged commit ae3eebb into main Feb 11, 2024
8 checks passed
@duncanmcclean duncanmcclean deleted the add-find-or-fail-methods-to-repositories branch February 11, 2024 14:09
Copy link

Released as part of v6.0.0.

1 similar comment
Copy link

Released as part of v6.0.0.

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.

None yet

1 participant