Mar 1, 2021
0
Level 2
Play with subscription restrictions
Hi, I'm going crazy testing the logic of restrictions via subscriptions with Stripe.
Coming to the point, I would like to manage content through subscriptions that have this logic:
- [If the user is logged in and has a subscription] [If the user has canceled his subscription but is still in the trial period]
2 [If the user has an expired or terminated subscription with immediate expiry]
3 [Finally, if he is a visitor]
I made a small draft to give an idea, but it seems that if I instantly terminate the subscription for a user (therefore with the immediate expiration which is therefore to be considered expired), it does not show the warning that it has expired.
@if(Auth::check() && Auth::user()->subscribed('default') || Auth::user()->subscription('default')->onGracePeriod())
[If the user is logged in and has a subscription]
[If the user has canceled his subscription but is still in the trial period]
@elseif(Auth::check() && Auth::user()->subscribed('default') && Auth::user()->subscription('default')->ended())
[If the user has an expired or terminated subscription with immediate expiry]
@else
[guest]
@endif
Please or to participate in this conversation.