Is it possible to override a function defined in the Laravel/Lumen Application
class?
For example, this is the definition of isDownForMaintenance
in the Lumen Application
class:
public function isDownForMaintenance() : bool
{
return false;
}
I would like to override this with my own implementation like so:
public function isDownForMaintenance() : bool
{
// Do something…
}
I have tried…
AppServiceProvider.php
$this->app->extend(‘app’, function () {
return new Application; // Extension of Laravel/Lumen/Application
});
Application.php
class Application extends BaseApplication
{
public function isDownForMaintenance() : bool
{
// Do Something…
}
}