master

laravel/framework

Last updated at: 29/12/2023 09:21

MaintenanceMode.php

TLDR

This file defines the MaintenanceMode interface, which contains methods for activating and deactivating maintenance mode, checking if maintenance mode is active, and retrieving the data provided when maintenance mode was activated.

Methods

activate

Takes an array payload as a parameter and activates maintenance mode for the application.

deactivate

Deactivates maintenance mode for the application.

active

Checks if the application is currently in maintenance mode and returns a boolean value.

data

Retrieves the data array that was provided when the application was placed into maintenance mode.

<?php

namespace Illuminate\Contracts\Foundation;

interface MaintenanceMode
{
    /**
     * Take the application down for maintenance.
     *
     * @param  array  $payload
     * @return void
     */
    public function activate(array $payload): void;

    /**
     * Take the application out of maintenance.
     *
     * @return void
     */
    public function deactivate(): void;

    /**
     * Determine if the application is currently down for maintenance.
     *
     * @return bool
     */
    public function active(): bool;

    /**
     * Get the data array which was provided when the application was placed into maintenance.
     *
     * @return array
     */
    public function data(): array;
}