PHP code example of zakariatlilani / laravel-minify

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

    

zakariatlilani / laravel-minify example snippets


php artisan vendor:publish --tag=LaravelMinify

->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \zakariatlilani\LaravelMinify\Middleware\LaravelMinifyHtml::class
    ]);
})

MINIFY_ACTIVATE=true

MINIFY_ONLY_PRODUCTION=false

'exclude_route' => [
        // 'routeName'
]

LaravelMinifyFacade::htmlMinify("<div>...</div>");

LaravelMinifyFacade::excludeHtmlMinify("<div>...</div>");

@excludeMinify
    <div> exclude code from Minify </div>
@endExcludeMinify