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

christian_H's avatar

Differentiate between a new user subscribing and an existing user on a free plan subscribing?

When a brand new user registers and subscribes to your site for the first time, and when an existing user who's been on a free plan subscribes, the UserSubscribed event is fired.

Is there a way to differentiate between the two cases? I would like additional code to run in the case of an existing user on a free plan subscribing, but since they're both firing the same event I'm not sure how to respond to one but not the other.

Does Spark have this sort of functionality built in, or will this require custom code? Has anyone implemented anything like this? All feedback is very appreciated, thank you!

If it makes a difference I'm using Laravel 5.2 and Spark 1.0

0 likes
2 replies
EventFellows's avatar

i'd just check the user obßn t h e ebvent fired whether users 'created_at' and 'updated_at' is the same (= new user) or not (exsting user).

3 likes
christian_H's avatar

@EventFellows that's a great idea... I ended up doing something similar, checking a field that would be null if it was a new user. But seems the easiest thing is to key in on some field on the user model.

Please or to participate in this conversation.