Replies: 1 comment
-
I'd accept a PR that adds this. Although not even sure it should be configurable, maybe we should just use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm currently integrating this package into a project where the application's root folder is configured differently from the Laravel default. Specifically, my application's root namespace is
Efekan
, and the source code resides in/src/
instead of the usual/app/
directory. I have configured the Composer autoloader accordingly to reflect this structure:Additionally, my
event-sourcing
config is set to auto-discover projectors and reactors within the/src/User/Domain/Projector
directory:Despite this setup, the auto-discovery mechanism fails to locate a projector class located within the specified directory. Debugging led me to
\Spatie\EventSourcing\Support\DiscoverEventHandlers
, where I noticed the discovery process does not correctly pick up the namespace of the file.I propose introducing a new configuration key,
auto_discover_root_namespace
, to specify the root namespace explicitly for projects that do not use the defaultApp\
namespace. This could be integrated within theEventSourcingServiceProvider
as follows:This adjustment has resolved the issue in my local environment, enabling the correct discovery of event handlers.
Beta Was this translation helpful? Give feedback.
All reactions