-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add env maintenance mode driver
- Loading branch information
Showing
4 changed files
with
66 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace App\Maintenance; | ||
|
||
use Illuminate\Contracts\Foundation\Application; | ||
use Illuminate\Contracts\Foundation\MaintenanceMode; | ||
|
||
class EnvMaintenanceMode implements MaintenanceMode | ||
{ | ||
public function __construct(protected Application $app) {} | ||
|
||
/** | ||
* 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 { | ||
return $this->app->environment(['maintenance']); | ||
} | ||
|
||
/** | ||
* Get the data array which was provided when the application was placed into maintenance. | ||
* | ||
* @return array | ||
*/ | ||
public function data(): array { | ||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters