PHP code example of churchportal / laravel-scheduled-maintenance

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

    

churchportal / laravel-scheduled-maintenance example snippets




return [
    /*
    |--------------------------------------------------------------------------
    | Prerequisites
    |--------------------------------------------------------------------------
    | Configure the table name and model for maintenance windows.  You can use
    | your own model as long as it extends the default class below.
    */

    'table_name' => 'scheduled_maintenance',
    'model' => \Churchportal\ScheduledMaintenance\Models\ScheduledMaintenanceModel::class,

    /*
    |--------------------------------------------------------------------------
    | Maintenance Defaults
    |--------------------------------------------------------------------------
    | These defaults will be used when scheduling maintenance windows or moving
    | your application to maintenance mode. You can customize these for each
    | maintenance window as needed.
    */

    'redirect_to' => null,
    'status_code' => 503,
    'bypass_secret' => null,

    /*
    |--------------------------------------------------------------------------
    | Bypass Cookie Name
    |--------------------------------------------------------------------------
    | This cookie will be created when you visit the bypass secret url. It's
    | recommended that you customize this cookie name to your env or app name
    */

    'bypass_cookie_name' => 'laravel_maintenance',

    /*
    |--------------------------------------------------------------------------
    | Excluded URIs
    |--------------------------------------------------------------------------
    | These paths will still be accessible during maintenance mode.  These will
    | apply to any maintenance windows so use with caution!
    */

    'except' => [
        'status',
    ],

    /*
    |--------------------------------------------------------------------------
    | Blade View
    |--------------------------------------------------------------------------
    | This view will be rendered when you application is in maintenance mode.
    | You should use your own view, the default we've provided is just an
    | example of how you could implement something.
    */

    'view' => 'scheduled-maintenance::down',
];


// In your Inerita middleware

\Inertia\Inertia::share([
    'upcomingMaintenance' => app('maintenance')->notice(),
]);

// In your Inerita middleware

\Inertia\Inertia::share([
    'bypassedMaintenance' => app('maintenance')->inBypassMode(),
]);
bash
php artisan vendor:publish --provider="Churchportal\ScheduledMaintenance\ScheduledMaintenanceServiceProvider"
bash
php artisan migrate