{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/7147","labels_url":"https://api.github.com/repos/laravel/framework/issues/7147/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/7147/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/7147/events","html_url":"https://github.com/laravel/framework/issues/7147","id":55625219,"number":7147,"title":"[5.0] Proposal: Vendor Assets publish command","user":{"login":"barryvdh","id":973269,"avatar_url":"https://avatars.githubusercontent.com/u/973269?v=3","gravatar_id":"","url":"https://api.github.com/users/barryvdh","html_url":"https://github.com/barryvdh","followers_url":"https://api.github.com/users/barryvdh/followers","following_url":"https://api.github.com/users/barryvdh/following{/other_user}","gists_url":"https://api.github.com/users/barryvdh/gists{/gist_id}","starred_url":"https://api.github.com/users/barryvdh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barryvdh/subscriptions","organizations_url":"https://api.github.com/users/barryvdh/orgs","repos_url":"https://api.github.com/users/barryvdh/repos","events_url":"https://api.github.com/users/barryvdh/events{/privacy}","received_events_url":"https://api.github.com/users/barryvdh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-27T14:38:07Z","updated_at":"2015-01-27T14:38:07Z","closed_at":null,"body":"For config/views etc, we have the `publishes()` method and the `php artisan vendor:publish` command. This works fine for files that should be published once and then modified by the developer, so they aren't overwritten by updates.\r\nPackage assets work differently, because they usually need to be re-published after updates.\r\n\r\nI suggest the create a `vendor:assets` (or similar) command to copy all public assets from packages to the user public folder. This could work similar in the ServiceProvider:\r\n`$this->assets([$sourceDir => $targetDir]);`\r\n\r\nOn publishing, the targetDir would be removed/emptied and the contents of the $sourceDir would be copied.\r\n\r\nConsiderations:\r\n- Restrict to a certain folder in the public, to prevent wrong overwriting? Eg. `public/vendor` or `public/packages` folder. (And to force best practice)\r\n- Symlink option to symlink the folders, instead of copying them. Could be even the default option, if possible?\r\n- Add a `vendor_assets()` folder, to provide easy access in views to the package files?\r\n\r\nThe command could be heavily based on the [Symfony AssetsInstallCommand](https://github.com/symfony/symfony/blob/2.7/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php), except that it uses the registered asset paths."}}