PHP code example of areia-lab / laravel-maintainer

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

    

areia-lab / laravel-maintainer example snippets


Route::get('/', function () {
    return view('welcome');
})->middleware(['maintenance.check']);

# Or as a group
Route::middleware(['maintenance.check'])->group(function () {
    Route::get('/', function () {
        return view('welcome');
    });
});
bash
php artisan vendor:publish --tag=maintainer-config
php artisan vendor:publish --tag=maintainer-views
bash
php artisan maintenance:enable

php artisan maintenance:enable --message="Upgrading" --ends-at="2025-09-12 03:00" --whitelist-ips="127.0.0.1" --whitelist-users="1,[email protected]"

php artisan maintenance:enable --force
bash
php artisan maintenance:disable

php artisan maintenance:disable --force