Download the PHP package mediactive-digital/laravel-asset-aliases without Composer
On this page you can find all versions of the php package mediactive-digital/laravel-asset-aliases. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mediactive-digital/laravel-asset-aliases
More information about mediactive-digital/laravel-asset-aliases
Files in mediactive-digital/laravel-asset-aliases
Package laravel-asset-aliases
Short Description Link CSS / JS files in Laravel Blade templates
License MIT
Informations about the package laravel-asset-aliases
Link CSS / JS files in Laravel Blade templates
This package makes it easier to link CSS / JS files in Laravel Blade templates.
Installation
Require the package using Composer.
Laravel < 5.5
Add the service provider to /config/app.php file.
Add the AssetManager facade to /config/app.php file.
Htaccess changes
In order to avoid cache issues, especially with nginx, this package add specific timestamp in the filename of js & css files. home.js
will be called as home.{timestamp}.js
. You will need to add the following rule to your .htaccess
file.
Usage
You can link either an internal resource or an external URL.
Link CSS files.
simple file
or array of files
Link JS files.
simple file
or array of files
Link CSS / JS files by aliases.
Add aliases to the configutation file located at /config/laravel-asset-aliases/alias.php.
Then link files by aliases, for example :
Support for HTML attributes.
You can pass any number of HTML attributes along with your file definition.\ It can be done both in configuration file and / or Blade templates.\ Attributes defined in Blade templates override configuration ones.
If you do so, you must use an associative array with the mandatory keys "file" and "attributes".\ "file" being your file (string) and "attributes" being your HTML attribute(s) (array).