阅读(4308) (1)

发布分类文件

2016-02-24 15:52:26 更新

您可能想要分别的发布一些分类的文件。举例,您可能想要您的用户可以分别发布扩展包的配置文件与静态资源文件。您可以使用 tagging 来达成:

// Publish a config file
$this->publishes([
    __DIR__.'/../config/package.php' => config_path('package.php')
], 'config');

// Publish your migrations
$this->publishes([
    __DIR__.'/../database/migrations/' => database_path('/migrations')
], 'migrations');

您可以使用这些 tag,来分别发布这些扩展包里的文件。

php artisan vendor:publish --provider="Vendor\Providers\PackageServiceProvider" --tag="config"