/AppServiceProvider.php Secret
Created
September 25, 2022 15:06
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
<?php | |
namespace App\Providers; | |
use App\Support\CustomMaintenanceMode; | |
use Illuminate\Contracts\Config\Repository; | |
use Illuminate\Contracts\Container\Container; | |
use Illuminate\Filesystem\FilesystemManager; | |
use Illuminate\Foundation\MaintenanceModeManager; | |
use Illuminate\Support\ServiceProvider; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Register any application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
$this->app->extend( | |
MaintenanceModeManager::class, | |
function (MaintenanceModeManager $manager) { | |
// Add the custom driver to the maintenance mode manager, telling the | |
$manager->extend('custom', function (Container $container) { | |
return new CustomMaintenanceMode( | |
$container->make(FilesystemManager::class), | |
$container->make(Repository::class)->get('app.maintenance.disk'), | |
); | |
}); | |
return $manager; | |
} | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment