php - How to dynamically load a list of classes?
I would like to load a list of classes dynamically. The general idea would be to have a sort of manifest/config file that contains an array list of classes and then they would "automatically" be loaded into my application instead of needing to manually do something like
use App\Controllers\UserController; use App\Controllers\ContractController; use App\Controllers\SubscriptionController; etc...
It seems there must be some way to achieve this as the Laravel framework does something similar with service providers. You register the classes once in
config/app.php and then these provider classes are auto loaded onto the app.