Enable pricing (#151)
* Enable Pro plan - WIP * no pricing page if have no paid plans * Set pricing ids in env * views & submissions FREE for all * extra param for env * form password FREE for all * Custom Code is PRO feature * Replace codeinput prism with codemirror * Better form Cleaning message * Added risky user email spam protection * fix form cleaning * Pricing page new UI * form cleaner * Polish changes * Fixed tests --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -179,6 +179,15 @@ class User extends Authenticatable implements JWTSubject //, MustVerifyEmail
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getIsRiskyAttribute()
|
||||
{
|
||||
return $this->created_at->isAfter(now()->subDays(3)) || // created in last 3 days
|
||||
$this->subscriptions()->where(function ($q) {
|
||||
$q->where('stripe_status', 'trialing')
|
||||
->orWhere('stripe_status', 'active');
|
||||
})->first()?->onTrial();
|
||||
}
|
||||
|
||||
public static function boot ()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
Reference in New Issue
Block a user