PHP code example of hollyit / laravel-static-libraries

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

    

hollyit / laravel-static-libraries example snippets


Event::listen(\HollyIT\StaticLibraries\Events\RegisterStaticLibrariesEvent::class,
    function (\HollyIT\StaticLibraries\Events\RegisterStaticLibrariesEvent $event) {
    $event->manager->add(
        Library::make('package1', __DIR__ . '/../dist')
            ->assets(
                Css::make('css/package1.css'),
                Js::make('js/package1.js')
            )
            ->

Css::make('css/package1.css', ['media' => print])

make(string $file, string $name, array $attributes = [])

Library::make('test1')
    ->assets(
        \HollyIT\StaticLibraries\StaticAssets\JsModule::make('js/module1.js', 'module1')
    )

Library::make('test2')->assets(
    \HollyIT\StaticLibraries\StaticAssets\JsModule::make('js/module2.js', 'module2')
)

    Library::make('tinymce_plugin', __DIR__)
    ->

    Library::make('tinymce_plugin', __DIR__)
    ->
bash
php artisan static-libraries:publish
bash
php artisan static-libraries:unpublish

        "post-update-cmd": [
            "@php artisan static-libraries:publish"
        ],