PHP code example of orchestra / asset

1. Go to this page and download the library: Download orchestra/asset 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/ */

    

orchestra / asset example snippets


'providers' => [

    // ...

    Orchestra\Asset\AssetServiceProvider::class,
    Collective\Html\HtmlServiceProvider::class,
    
],

'aliases' => [

    // ...

    'Asset' => Orchestra\Support\Facades\Asset::class,

],

Asset::add('jquery', 'js/jquery.js');

Asset::add('jquery-ui', 'js/jquery-ui.js', 'jquery');

Asset::add('jquery-ui', 'js/jquery-ui.js', ['first', 'second']);

Asset::container('footer')->add('example', 'js/example.js');

{!! Asset::container('footer')->scripts() !!}

Asset::container()->addVersioning();

// or alternatively
Asset::addVersioning();

Asset::container()->removeVersioning();

// or alternatively
Asset::removeVersioning();