Support the ongoing development of Laravel.io →
Packages Laravel

I have a Laravel package located in the packages/ directory. I want to dynamically load and register it without manually running composer dump-autoload or any CLI commands.

Requirements: The package should be discovered and available after visiting a specific route (e.g., /discover-package). It should be persistently available, even after clearing cache, sessions, or restarting the server. The solution should be fully programmatic, meaning any new package added should be detected and loaded dynamically. The package’s service provider and classes must be autoloaded correctly within Laravel’s application lifecycle. Has anyone implemented a similar solution? What is the best way to achieve this?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

yash yashpatel124 Joined 1 Mar 2025

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.