I want to add the \Clockwork\Support\Laravel\ClockworkMiddleware::class middleware to $middleware in App\Http\Kernel, but only if the app environment is local.
Is there a better way to do this than extending the App\Http\Kernel constructor?
public function __construct(Application $app, Router $router)
{
if ($this->app->environment('local')) {
$this->pushMiddleware(\Clockwork\Support\Laravel\ClockworkMiddleware::class);
}
parent::__construct($app, $router);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire