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

[7.19] AntiVirus: Service auto-discovery #177

Closed
tminich opened this issue Aug 15, 2023 · 2 comments
Closed

[7.19] AntiVirus: Service auto-discovery #177

tminich opened this issue Aug 15, 2023 · 2 comments
Labels
documentation Documentation related feature or issue question Further information is requested

Comments

@tminich
Copy link

tminich commented Aug 15, 2023

Description

Most Laravel packages have auto-discovery for their services. Is there a reason why the service for the AntiVirus package needs to be added manually?

Possible solution

Add a extra->laravel->providers entry to composer.json to allow the service to be auto-discovered.

@aedart
Copy link
Owner

aedart commented Aug 15, 2023

Hi @tminich. Thus far I have avoided using auto-discovery, because some of my packages offer more than one service provider and I wanted to avoid creating conflicts / unwanted situations by automatically registration of certain bindings. This is especially true when I overwrite some of Laravel's own native bindings (but that is not the case for the AntiVirus package).
Should you require the AntiVirus components for more than one project, then you can always create a "wrapper" package that automatically discovers it - or perhaps your own custom service provider with configuration and settings that fit your purposes.

In future major version(s), I might reconsider my approach for all of my packages. But for now, you will have to manually register the required service provider (sorry).

@tminich
Copy link
Author

tminich commented Aug 15, 2023

That's perfectly reasonable. Basically I was wondering if it's intentional or an oversight and you cleared that up =)

Feel free to just close this or leave it open if you want to keep it as a reminder for the future.

@aedart aedart closed this as completed Aug 15, 2023
@aedart aedart added the documentation Documentation related feature or issue label Aug 15, 2023
@aedart aedart pinned this issue Aug 15, 2023
@aedart aedart added the question Further information is requested label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related feature or issue question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants