Laravel 4: publishing package assets

How to publish bundled assets? I found a tutorial here: http://laravel-recipes.com/recipes/279

But when I tried to publish assets from my toolkit, I get this error:

[RuntimeException]         
 Unable to publish assets.  

asset:publish [--bench[="..."]] [--path[="..."]] [package]

My command code is:

php artisan asset:publish --bench=Mypackage

How can I publish my package assets.

Thanks.

+4
source share
4 answers

If you want to publish assets that have been developed and stored in your workplace, you must use the flag --bench. In your case, you want to publish the package to the vendor folder, then specify "myVendor / myPackage".

Publishing assets from a vendor package

php artisan asset:publish "vendor/package"

Publish assets from workbench

php artisan asset:publish --bench="vendor/package"
+6

Bootstrap Twitter.

"public/packages":

php artisan asset:publish --path="vendor/twitter/bootstrap/dist"

"public/":

php artisan asset:publish --path="vendor/twitter/bootstrap/dist" "../"
+3

Workbench, Laravel.

:

/src
    /Vendor
        /Package
            PackageServiceProvider.php
    /config
    /lang
    /migrations
    /views
/tests

/public < ----

, -, imgs/css/js ( assets, -).

, :

php artisan asset:publish --bench=Mypackage

/approot
/public
    /vendor/package/

: http://laravel.com/docs/packages

+1

Twitter Bootstrap ( SASS), :

php artisan asset:publish --path="vendor\twbs\bootstrap-sass\assets"  .

(3 ) public/packages.

When I didn’t have ., there was no message at the end and nothing was copied.

And when I skipped the directory assetsin the command, all the contents of the directory vendor\twbs\bootstrap-sasswere copied to the directory public, which, of course, is not necessary

+1
source

Source: https://habr.com/ru/post/1525559/


All Articles