Refactor subscription handling logic in middleware and model
This commit is contained in:
parent
f78fd212bb
commit
3b942049a2
@ -44,7 +44,7 @@ public function handle(Request $request, Closure $next): Response
|
||||
if (auth()->user()->hasVerifiedEmail() && $request->path() === 'verify') {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
if (isSubscriptionActive() && $request->path() === 'subscription') {
|
||||
if (isSubscriptionActive() && $request->routeIs('subscription.index')) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
return $next($request);
|
||||
|
@ -54,7 +54,6 @@ public function type()
|
||||
};
|
||||
})->first();
|
||||
if ($stripePlanId) {
|
||||
raY($stripePlanId);
|
||||
return str($stripePlanId)->after('stripe_price_id_')->before('_')->lower();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user