Reputation: 372
Standard Laravel structure is
app
---http
------Controllers
---------MyComponentController
---Models
------MyComponentModel
---database
------MyComponentnMigration
I wonder if there is the chance to change the folder structure to:
app
---MyComponent // kind of a package that holds all mandatory elements
------Controllers
---------Controller
------Models
---------Model
------database
---------Migration
as it would make much more sense.
update
**why does people vote it down ? it is a serious question, a model has a dependency to a migration. so if you want to use the model in another project you have to search the migration in the project and all other relevant items that has a connection with it. if all mandatory files would be structured under one parent node it would be just a copy and paste.
It would be at least honest to understand why those down voters think this isn't a good idea **
Upvotes: 4
Views: 1558
Reputation: 895
Yes you can, actually we already did what you're thinking. We create a separate Folder and inside of it Models, Controllers, Requests , Views, Routes
You just need to update the RouteProviders
to rellocate your Controllers by modifying the namespace and for the Views
. you just need to update via config folder
.
Upvotes: 4