This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

An asset management package for Laravel 5.

1.0.2 2016-03-25 10:29 UTC

This package is auto-updated.

Last update: 2021-10-14 17:48:06 UTC


This package is baset on

Casset is an asset manager for Laravel 5 applications. Some things it can do:

  • Create one or more asset containers.
  • Compile less files.
  • Combine assets into one file.
  • Minify output.
  • Accept assets from Laravel package public directories. "package::/js/file.js"
  • Define dependencies for an asset.
  • Define global dependencies for all assets of the same file type.
  • Define an optional CDN for asset URLs.
  • Optionally defer processing/combining assets to a controller (useful when distributing page requests across multiple servers).

Installation via Composer

Add this to your composer.json file, in the require object:

"simexis/laravel-casset": "dev-master"

After that, run composer install to install Casset.

Add the service provider to app/config/app.php, within the providers array.

'providers' => array(
	// ...

Add a class alias to app/config/app.php, within the aliases array.

'aliases' => array(
	// ...
	'Casset' => Simexis\Casset\Facades\Casset::class,

Finally, ensure the cache directory defined in the config file is created and writable by the web server (defaults to public/assets/cache).

$ mkdir public/assets/cache
$ chmod -R 777 public/assets/cache
$ touch public/assets/cache/.gitignore

Edit public/assets/cache/.gitignore.



Add assets to the "default" container:


Add assets to a custom container:


Add an asset with a dependency on another asset:

Casset::add('less/layout.less', array(), array('less/variables.less'));

Add a global dependency for all assets (of the same file type):


Add assets from a composer package (vendorName/packageName):


Render HTML tags to load assets for a container:

{!! Casset::container('default')->styles() !!}
{!! Casset::container('layout')->scripts() !!}

Generate a URL to an asset on the CDN server:

<img src="{{ Casset::cdn('logo.png') }}" />