Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alexmansour's avatar

L5.2 Cashier Without Credit Card Up Front

Hello,

I'm planning to offer trial period without requiring credit card upfront but I have the following two concerns:

1- For route middleware, I came up with the following, any security concerns with this middleware?

if ($request->user() && $request->user()->onTrial() ) {

            return $next($request);

        }elseif ($request->user() && $request->user()->subscribed('basic') ) {

            return $next($request);

        }else {

            return redirect()->route('subscription');

        }

2- If I want to allow the user to create actual subscription while they are still on their generic period, How we can make sure that the user only get charged when their generic trial ends? In this case the Stripe plan needs to have trial days defined ?

Thank you.

0 likes
0 replies

Please or to participate in this conversation.