rundum/event-bundle
A Symfony bundle for adding events to your application. It provides Doctrine entities and ready-to-use controllers and templates for creating, organizing, and displaying event listings, with an extensible structure that fits existing Symfony projects.
This package gives Laravel applications a way to discover Doctrine entity classes by scanning the project directory rather than relying on hand-maintained entity lists. The 0.1.13 release adds a scan method that finds entities even when the application uses multiple entity managers.
Minimal setup:
php artisan vendor:publish --tag=...). This is the first place to look for scan paths, namespace filters, and entity-manager mappings.scan method is the primary entry point introduced in 0.1.13.First use case: call scan from a service provider, an Artisan command, or a test to obtain the list of entity classes under your application namespace. With multiple entity managers configured, the scanner should identify entities across the relevant directories so you can register or validate them per manager without duplicating path configuration.
A minimal invocation in a service provider might look like:
$entities = $scanner->scan();
Use the result to feed entity registration, schema tooling, or migration generation. Start by scanning only your application's entity directories; expand scope after confirming the output is correct.
Scan once, cache the result. Directory scanning is not free. Run scan during deployment, in a cached config, or in a scheduled command and persist the class list. In day-to-day development, call it dynamically; in production, hydrate from cache.
Group by entity manager. The headline feature is support for multiple entity managers. Use the scan output alongside each manager's configured entity paths to ensure entities land with the correct manager. A typical pattern is to scan all candidate directories once, then partition the class list by namespace or configured path per manager.
Register entities in a service provider. A common integration is to run the scan at boot or in a dedicated registrar class and pass the discovered classes to the Doctrine configuration for each manager. Keep this in a single registrar to avoid boot-order surprises.
Expose an Artisan command. Wrap the scanner in php artisan entities:scan returning a table of discovered classes and inferred managers. This is the fastest way to debug configuration and a useful CI check that every expected entity is discoverable.
Use it in tests. Assert that scan() returns expected entity classes for each manager. This guards against a class being moved or renamed while doctrine configuration still points at the old location.
Pair with schema and migration tooling. The scan result is a reliable input for schema validation, diff generation, or migration commands that need the full entity set across managers.
Filter aggressively. If the scanner accepts paths, namespaces, or exclusion patterns, pass them explicitly. Restricting the scan to app/Entities and similar directories keeps results deterministic and fast.
vendor, storage, test fixtures, and generated code. Always constrain paths or exclusions; otherwise you will pick up unrelated classes or slow the scan dramatically.composer dump-autoload) before they appear. A stale autoloader is a common cause of "missing entity" reports after refactoring.config:cache does not freeze a stale path list.scan method is new in 0.1.13. Pin at least this version if you depend on it, and review the scanner's public API before upgrading, since the package is still pre-1.0.How can I help you explore Laravel packages today?