diff --git a/src/Illuminate/Foundation/Configuration/Middleware.php b/src/Illuminate/Foundation/Configuration/Middleware.php index 1ca8294c2b47..e8916d552d44 100644 --- a/src/Illuminate/Foundation/Configuration/Middleware.php +++ b/src/Illuminate/Foundation/Configuration/Middleware.php @@ -737,7 +737,7 @@ public function getMiddlewareAliases() */ protected function defaultAliases() { - return [ + $aliases = [ 'auth' => \Illuminate\Auth\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, @@ -747,12 +747,17 @@ protected function defaultAliases() 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, - 'subscribed' => \Spark\Http\Middleware\VerifyBillableIsSubscribed::class, 'throttle' => $this->throttleWithRedis ? \Illuminate\Routing\Middleware\ThrottleRequestsWithRedis::class : \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; + + if (class_exists(\Spark\Http\Middleware\VerifyBillableIsSubscribed::class)) { + $aliases['subscribed'] = \Spark\Http\Middleware\VerifyBillableIsSubscribed::class; + } + + return $aliases; } /**