[5.0] [PROPOSAL] Change Package Structure
Should we update the default package structure to be more like the new structure in laravel/laravel?
We need to consider how to register the new structure in the service provider vs the old structure if we do change this (including moving to psr-4 autoloading).
Old structure:
/src
/Vendor
/Package
PackageServiceProvider.php
/config
/lang
/migrations
/views
/tests
/public
Proposed new structure:
/config
/src
PackageServiceProvider.php
/tests
/database
/migrations
/resources
/lang
/views
/public
Or maybe we could just dump everything in the resources folder?
Alternative proposed new structure:
/src
PackageServiceProvider.php
/tests
/resources
/config
/lang
/migrations
/views
/public
I like the last one, looks a lot cleaner. Or really even the second one but just, anything that doesn't force me to mix my PSR namespace and random files like currently.
Yeh. My first proposal was designed to match the app structure as much as possible, but I prefer the second option of putting everything in resources by default too.
For anyone wanting to use the second option, you can already do this by passing a third param to the package method in your service provider, but this proposal is for changing the default to this. :)
I vote for the alternative one. Putting everything else into the resource folder looks more cleaner to me :+1:
:thumbsup:
Second looks cleaner for sure. I prefer that structure.
One change that would make this easy is for the migrator to use the path set in the ServiceProvder.
Currently it is set hardcoded: https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Console/Migrations/BaseCommand.php
I currently already use the second option except for migrations. +1 for the second to be default
The migrations can be changed too in laravel 5 I guess. We should probably aim to remove that hard coded stuff too.
:+1: like the alernative proposed structure, looks clean to me
:+1: like the alternative structure
Definitely a fan of the alternative structure! Mirroring L5's new concepts sounds awesome, and I never liked having to put config files in src.
NB, the pull to implement this is: #5870.