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

Prevent unnecessary query call when model exists #143

Merged
merged 1 commit into from
Feb 23, 2022
Merged

Prevent unnecessary query call when model exists #143

merged 1 commit into from
Feb 23, 2022

Conversation

dmason30
Copy link
Contributor

The changes in #141 #142 caused lots of duplicate query calls for me:
image

This fixes it by moving hasTable query call added in #141 #142 to a catch QueryException so that it only runs when it actually needs to.

@AlexisSerneels @haringsrob Feel free to discuss

@haringsrob
Copy link
Contributor

Just now that I think about it, we only have to do this when app()->runningInConsole().

But this would work as well I guess.

@freekmurze freekmurze merged commit 8c12c70 into spatie:main Feb 23, 2022
@dmason30 dmason30 deleted the fix-query-calls branch February 23, 2022 20:22
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.

3 participants