Reactors and Projectors not Auto Discovered #345
-
This also affects a previous issue that was previously closed. #301 . Please find a link to a sample app I created with a differently namespaced domain. https://github.com/anabeto93/spatie-es-auto-discovery When projectors and reactors are differently namespaced, ie does not follow the default "autoload": {
"psr-4": {
"App\\": "app/",
"Domain\\": "app/Domain/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
} Supplying a path such as Doing this still presents a problem where running If the If however, the base path to the differently namespaced projectors and reactors are supplied to 'auto_discover_projectors_and_reactors' => [
app()->path('Domain/App'),
], |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@anabeto93 - In the closed issue that you reference, @brendt requested that you submit a PR with a failing test so that this issue may be addressed. I recommend doing so as opposed to continuing to create issues. Note that the <?php
return [
/*
* These directories will be scanned for projectors and reactors. They
* will be registered to Projectionist automatically.
*/
'auto_discover_projectors_and_reactors' => [
base_path('app/Domain')
],
/*
* This directory will be used as the base path when scanning
* for projectors and reactors.
*/
'auto_discover_base_path' => base_path('app'),
]; |
Beta Was this translation helpful? Give feedback.
@anabeto93 - In the closed issue that you reference, @brendt requested that you submit a PR with a failing test so that this issue may be addressed. I recommend doing so as opposed to continuing to create issues.
Note that the
auto_discover_base_path
value defines the path that will be stripped from the class name to determine the FQDN. In this scenario, your configuration should be as follows: