PHP code example of ideal-creative-lab / laravel-tachyon

1. Go to this page and download the library: Download ideal-creative-lab/laravel-tachyon 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/ */

    

ideal-creative-lab / laravel-tachyon example snippets


// bootstrap/app.php

return Application::configure(basePath: dirname(__DIR__))
    ...
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->append([
            \DotNinth\LaravelTachyon\Middleware\RemoveComments::class,
            \DotNinth\LaravelTachyon\Middleware\CollapseWhitespace::class,
            \DotNinth\LaravelTachyon\Middleware\ElideAttributes::class,
            \DotNinth\LaravelTachyon\Middleware\InlineCss::class,
            \DotNinth\LaravelTachyon\Middleware\InsertDNSPrefetch::class,
            \DotNinth\LaravelTachyon\Middleware\DeferJavascript::class,
        ]);
    })
    ...

// config/laravel-tachyon.php

//Set this field to false to disable the Laravel Tachyon service.
'enable' => env('LARAVEL_TACHYON_ENABLED', true),

// config/laravel-tachyon.php

//You can use * as wildcard.
'skip' => [
    '*.pdf', //Ignore all routes with final .pdf
    '*/downloads/*',//Ignore all routes that contain 'downloads'
    'assets/*', // Ignore all routes with the 'assets' prefix
];
zsh
php artisan vendor:publish --provider="DotNinth\LaravelTachyon\ServiceProvider"