PHP code example of brickx / laravel-filament-maintenance

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

    

brickx / laravel-filament-maintenance example snippets


return [
    'secret' => null,
    'refresh' => false,
    'permissions' => false,
    'role' => false,
    'tiny_toggle' => false,
];

use Illuminate\Foundation\Http\MaintenanceModeBypassCookie;
use Illuminate\Http\RedirectResponse;

...

protected function bypassResponse(string $secret) : RedirectResponse
{
    return redirect('admin')->withCookie(
        MaintenanceModeBypassCookie::create($secret)
    );
}
bash
php artisan vendor:publish --tag="filament-maintenance-config"
bash
php artisan vendor:publish --tag="filament-maintenance-translations"
bash
php artisan vendor:publish --tag="filament-maintenance-views"