PHP code example of realdriss / assets

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

    

realdriss / assets example snippets


// config/app.php
'providers' => [
    ...
    RealDriss\Assets\Providers\AssetsServiceProvider::class,
];

// config/app.php
'aliases' => [
    ...
    'Assets' => RealDriss\Assets\Facades\AssetsFacade::class,
];

{!! \Assets::renderHeader() !!}

{!! \Assets::renderFooter() !!}

\Assets::addScripts(['key-of-assets-in-config-file']);

\Assets::addScripts(['app', 'bootstrap', 'jquery']);

\Assets::addStyles(['key-of-assets-in-config-file']);

\Assets::addStyles(['bootstrap', 'font-awesome']);

\Assets::removeScripts(['key-of-assets-in-config-file']);

\Assets::removeScripts(['bootstrap']);

\Assets::removeStyles(['key-of-assets-in-config-file']);

\Assets::removeStyles(['font-awesome']);
bash
php artisan vendor:publish --provider="RealDriss\Assets\Providers\AssetsServiceProvider" --tag=config