8000 Event Auto-Discovery with Custom Namespace · Issue #56166 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content
Event Auto-Discovery with Custom Namespace #56166
Closed
@patriziotomato

Description

@patriziotomato

Laravel Version

12.19.3

PHP Version

8.4

Database Driver & Version

MariaDB 10.6

Description

Not sure if this is a bug or a feature request, but I have sub-modules in my Laravel Project.

Project folder
- src
- Module 1
-- src
-- ModuleServiceProvider.php
--- Listeners
- Module 2

Module 1 has a custom Namespace, registered in my composer.json. So I was thinking quiet a common usecase.

Right now there is no way to just add another Listener-Folder to Laravel with a Custom Namespace. It is trying to load the Listeners using the default Namespace.

Illuminate\Foundation\Events\DiscoverEvents::getListenerEvents() here my Listeners get excluded because of a ReflectionException.

Same is expected to happen if the module is a dedicated Laravel package.

Steps To Reproduce

  • Create a new Laravel project
  • Add a folder with a package like structure
  • Add a "src" folder
  • Add the "src" folder and give it a custom Namespace in your composer.json
  • Try to add the Listener folder to Laravel Event auto-discovery

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0