laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.2k stars 10.89k forks source link

[Proposal] Allow custom paths for Publisher #4013

Closed barryvdh closed 10 years ago

barryvdh commented 10 years ago

Right now, all paths are hardcoded (src/views, src/config, src/migrations, public) in the Asset/Config/ViewPublisher or MigrationPublishCommand.

The paths for views, configuration and language, are already set with the Serviceprovider->package() method, but aren't used by the Publisher.

I propose we first try to look in the registered packages, if a config/view/etc directory is set, and then use that to publish the files. An additional option I would propose is setting multiple directories, but this is mainly for the AssetPublisher

Examples for usage:

A possible implementation would be additional options to set in the serviceprovider and register the paths in the Application container. This would also make it possible to publish based on the namespace name, instead of vendor/package

arryanggaputra commented 10 years ago

i agree with this.

Anahkiasen commented 10 years ago

:+1: Has been mentioned in the past and for some reason was turned down but I see no reason to refuse this.

anlutro commented 10 years ago

Yes please. With PSR-4 I really cannot stand the default paths for my packages.

I think this would involve packages including some sort of config file in the package root path, indicating paths to migrations, views etc. as you cannot rely on the package's service provider being loaded.

Alternatively, require the package's service provider to be loaded for publish commands to be utilized.

taylorotwell commented 10 years ago

If someone wants to look into it go for it.