PHP code example of sayboot / assets

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

    

sayboot / assets example snippets


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

// config/app.php
'aliases' => [
    ...
    'Assets' => SayBoot\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="SayBoot\Assets\Providers\AssetsServiceProvider" --tag=config