PHP code example of slushie / laravel-assetic
1. Go to this page and download the library: Download slushie/laravel-assetic library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
slushie / laravel-assetic example snippets
'providers' => array(
...
'Slushie\LaravelAssetic\LaravelAsseticServiceProvider',
...
),
'aliases' => array(
...
'Asset' => 'Slushie\LaravelAssetic\Facades\AssetFacade',
...
),
'filters' => array(
'css_min' => 'Assetic\Filter\CssMinFilter',
'css_import' => 'Assetic\Filter\CssImportFilter',
'css_rewrite' => 'Assetic\Filter\CssRewriteFilter',
'embed_css' => 'Assetic\Filter\PhpCssEmbedFilter',
'less_php' => 'Assetic\Filter\LessphpFilter',
'js_min' => 'Assetic\Filter\JSMinFilter',
'coffee_script' => 'Assetic\Filter\CoffeeScriptFilter',
'yui_js' => function () {
return new Assetic\Filter\Yui\JsCompressorFilter('yui-compressor.jar');
},
),
'groups' => array(
'main_js' => array(
'filters' => array(
'js_min',
),
'assets' => array(
'jquery', // Named asset defined below
'assets/js/common/search.js', // Single file
'assets/js/coolarize/*js', // Folder inclusion
),
'output' => 'scripts.js', // Writable output relative to public_path()
),
),
bash
php artisan config:publish slushie/laravel-assetic
app/config/packages/slushie/laravel-assetic/config.php
html
<script src=" echo Asset::url('main_js');
bash
php artisan asset:warm