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

Don't boot Nova Request in the Service Provider #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tylernathanreed
Copy link

@tylernathanreed tylernathanreed commented Dec 22, 2023

After installing this package, I ran into an issue that was a bit tricky to source, but it ultimately comes back here.

In short, the service provider for this package injects NovaRequest as a dependency to the service provider's boot method. Booting a form request early in the lifecycle of a Laravel application causes unintended side-effects.

This PR simply changes the service provider to inject the NovaRequest instance as its needed, which is inside of macros exclusively. In other words, until one of these macros is called, the NovaRequest instance isn't resolved out of the container. This prevents said side-effects.

Additionally, macros are loaded statically, so you don't need to register them on the ServingNova event; you can just register them.

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