@sstringer I don’t know if it’s related, but directories and classes should be named using the “StudlyCase” (MyTables, MyExample etc) convention rather than “snake_case”.
How Do I Organize Lumen Models in a Subdirectory Properly?
I feel like an idiot asking this, but for the life of me, I cannot get Lumen to see my models if I move them into a subdirectory. And, yes, I added the model path as a "use" parameter up at the top of my controller.
Some background: this is my first Lumen project, but not my first Laravel project. I am building an API to a database with hundreds of tables, and I would like to organize the models that access these tables with a little more elegance than just dumping them in my app folder.
I should mention up top that I'm really just looking to autoload my model classes. I don't need to keep them in a separate namespace.
So, by default, my_example model is accessible without a problem when it's at the root of the app folder app/my_example.php. But let's pretend I want to put it in app/my_tables/my_example.php. In my controller I've tried any number of things, including the brute-force method that should work, use App\my_tables\my_example;. However, Lumen keeps throwing an error saying it can't find my model.
Any help on getting my model that live in subdirectories to autoload would be much appreciated. I'm sure it's simple. I'm just not groking it.
Thanks, steve
Please or to participate in this conversation.