How to publish package assets? I've found a tutorial here: http://laravel-recipes.com/recipes/279
But when I tried to publish assets from my workbench, 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 get my package assets to be published.
Thank you.
When you want to publish assets that are developed and stored in your workbench you should use the
--bench
flag. In your case you want to publish a package in the vendor folder then provide "myVendor/myPackage".Publishing assets from a vendor package
Publishing assets from a workbench package
I'll give an example with Twitter Bootstrap Package.
If you want to publish your assets in the folder "public/packages" :
If you want to publish your assets in the folder "public/" :
You use the Workbench to prepare your own package for use in Laravel.
There is a directory structure for where to place your files:
/public <---- the folder in question here
When preparing your package, any files that need to be accessible from the web server like imgs/css/js files (or
assets
as they are typically called in web apps) are put here.Then when you enter the command:
it will deploy those files into
more info here: http://laravel.com/docs/packages
When I wanted to copy Twitter Bootstrap (SASS version) for me worked only:
it copied assets folder content (3 directories) to
public/packages
.When I had no
.
at the end there was no message and nothing was copied.And when I omitted
assets
directory in the command the wholevendor\twbs\bootstrap-sass
directory content was copied topublic
directory what is of course unnecessary