PHP code example of ctf0 / blazar

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

    

ctf0 / blazar example snippets


'providers' => [
    ctf0\Blazar\BlazarServiceProvider::class,
]

protected $middlewareGroups = [
    // ...
    \ctf0\Blazar\Middleware\Blazar::class,
];

protected $routeMiddleware = [
    // ...
    'dont-pre-render' => \ctf0\Blazar\Middleware\DontPreRender::class,
];

return [
    /*
     * puppeteer bin path
     */
    'puppeteer_path' => '',

    /*
     * puppeteer script path
     *
     * leave it empty to the use the one from the package
     */
    'script_path' => '',

    /*
     * prerender the page only if the url is being visited from a bot/crawler
     */
    'bots_only' => false,

    /*
     * log the url when its processed by puppeteer
     */
    'debug' => true,

    /**
     *  clear user cache on logout
     */
    'clear_user_cache' => true
];

Artisan::call('blazar:flush');
bash
php artisan blazar:flush