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

Throw an exception when a required model is missing #622

Merged
merged 1 commit into from
May 5, 2023
Merged

Throw an exception when a required model is missing #622

merged 1 commit into from
May 5, 2023

Conversation

faustbrian
Copy link
Contributor

Resolves #340

Currently it only throws in two places, based on the cases I could track down where modelForContext is called and afterwards a Model instance is expected or unhandled exceptions will be encountered.

@jasonmccreary
Copy link
Collaborator

What is a place where we wouldn't throw an exception?

@faustbrian
Copy link
Contributor Author

There are a fair few places that call modelForContext followed by is_null calls on the return value of it and then doing something when modelForContext returned null.

@jasonmccreary jasonmccreary merged commit 1eeeb64 into laravel-shift:master May 5, 2023
@faustbrian faustbrian deleted the feat/throw-missing-model branch May 6, 2023 01:53
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.

Friendly warning for missing models
2 participants