Aristona
Aristona

Reputation: 9341

How can I push my package's assets into root directory?

I have a package with some assets.

 vendor/package/src/assets/css|js|img etc.

How can I move those assets into root directory after installation or updating?

Also, the second question is, can I do this task with PHP? For example:

 Route::get('update/{package_name}', function() {

      //Trigger composer here

 });

Thank you.

Upvotes: 1

Views: 639

Answers (2)

paoloumali
paoloumali

Reputation: 65

I think what he wants is a different destination folder not the source folder. --path is useful when you have a different source folder I believe.

Upvotes: 0

Simon Wicki
Simon Wicki

Reputation: 4059

there is an artisan command for that

php artisan asset:publish vendor/package

for this to properly work, you'd need to put your assets into a public folder within your vendor package like vendor/package/public/(css|js|img|...) and everything will be published to your root under public/packages/vendor/package/(css|js|img|...).

you can specify a path from the root, if you're not using the public folder:

php artisan asset:publish vendor/package --path="vendor/vendorname/package/src/assets"

docs: http://laravel.com/docs/packages#package-assets (although the path parameter is not mentioned there)

Upvotes: 2

Related Questions