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

[11.x] Auto discover Events outside app namespace when folder name is in kebab-case #52976

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

xizprodev
Copy link
Contributor

@xizprodev xizprodev commented Sep 29, 2024

Should fix:
#52975

Reproduction repo url: https://github.com/xizprodev/laravel-with-events.

Update:
Laravel 11 events are not auto discovered outside app folder when folder name is in kebab-case.

Example structure:
app
bootstrap
...
modules
modules-core (like custom-namespace in repo example)

In this case The method DiscoverEvents::classFromFile return Custom-namespace\FolderName\Listeners\CustomListenerName instead of CustomNamespace\FolderName\Listeners\CustomListenerName

@xizprodev xizprodev force-pushed the 11.x_52975_discover_events branch from 3133bb5 to b6c8e15 Compare September 29, 2024 18:54
@crynobone
Copy link
Member

@xizprodev Please update the title and description for this PR so @taylorotwell can understand this better without having to read both PR and issue.

@crynobone crynobone linked an issue Sep 30, 2024 that may be closed by this pull request
@crynobone crynobone marked this pull request as draft September 30, 2024 13:14
@xizprodev xizprodev changed the title DiscoverEvents::classFromFile Laravel 11 events are not auto discovered outside app folder when folder name is in kebab-case Sep 30, 2024
@xizprodev
Copy link
Contributor Author

@crynobone updated!
i hope new description is clear.
thank you!

@crynobone crynobone marked this pull request as ready for review October 1, 2024 01:15
@crynobone crynobone changed the title Laravel 11 events are not auto discovered outside app folder when folder name is in kebab-case [11x] Auto discover Events outside app namespace when folder name is in kebab-case Oct 1, 2024
@crynobone crynobone changed the title [11x] Auto discover Events outside app namespace when folder name is in kebab-case [11.x] Auto discover Events outside app namespace when folder name is in kebab-case Oct 1, 2024
@taylorotwell taylorotwell merged commit 1f7b884 into laravel:11.x Oct 1, 2024
31 checks passed
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.

Laravel 11 events are not auto discovered outside app folder
3 participants