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

danielmeade's avatar

Hold Spark subscriptions until Email is Verified

Hi all,

I'm taking Credit Card info upfront for my application, but it's important that users verify their email before they can use the service (a working email address is integral to the application) so I'm forcing the verification process.

Is there a way I can hold the start of their subscription until they have verified their email? i.e on verification, users card is charged and subscription starts

0 likes
9 replies
danielmeade's avatar

@KEL_ - Thanks @kel_ but the docs do not address my problem. The docs detail how to prompt the user to verify their email before they can use the application, but it says nothing about preventing the subscription (the payments) from starting until the email is verified.

The scenario I'm keen to avoid is this:

User registers with card details, payment is taken and subscription begins, user does not verify email and doesn't ever log in to the application, but the monthly subscription payment is still taken.

If the user has not verified their email, I want to prevent payments from being taken.

diegoaurino's avatar

you can pass the ['verify' => true] directly in the route like this:

Auth::routes(['verify' => true]);

diegoaurino's avatar

In other words, you can use " Auth::routes([‘verify’ => true]); " in the page route where the credit card information is required. Thus, unverified users will not be able to access this route. 

So, your route will look as follows:

Route::get(‘/payments’, function () {
    // Only verified users may enter...
})->middleware(‘verified’);

Note that you must implement Illuminate\Contracts\Auth\MustVerifyEmail.

Also check this lesson if you are facing difficulties in the process: [https://laracasts.com/series/whats-new-in-laravel-5-7/episodes/1]

Let me know if it helps

1 like
danielmeade's avatar

@DIEGOAURINO - Thanks @diegoaurino. I had thought about this approach but I really need to be able to take payment info at the point of user registration so this wouldn't work for my use case.

steve_laracasts's avatar

Pretty sure that still doesn't solve the problem?

Personally I wouldn't worry about this unless it becomes a problem in practice. Having run subscription sites for years there are definitely folk who will let you know the moment there is a problem.

diegoaurino's avatar

@danielmeade Have you tried to create two different areas/groups in your routes? One for the registration and payments only, and other that is only accessible if the verification is confirmed?

danielmeade's avatar

@DIEGOAURINO - Yeah, this is how I have it set up currently. Maybe I just don't need to worry about it. I just wanted to avoid support requests and chargebacks.

diegoaurino's avatar

@danielmeade I know that some payment processing apis let you confirm that the credit card has funds to register. You can use this feature to charge the user only after the email verification. Then you can create a listener to trigger once you get the verification back. Thus it gets easy to charge the user for the subscription.

1 like

Please or to participate in this conversation.