added crypto pm and activation key system

This commit is contained in:
Gitea
2025-05-16 11:24:08 +05:30
parent 23b5a45d0b
commit 93515e7845
11 changed files with 454 additions and 13 deletions

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ActivationKey extends Model
{
use HasFactory;
protected $fillable = [
'user_id',
'activation_key',
'price_id',
'is_activated',
];
protected $casts = [
'is_activated' => 'boolean',
];
/**
* Relationship: the user who redeemed the activation key (optional).
*/
public function user()
{
return $this->belongsTo(User::class);
}
/**
* Scope to filter unactivated keys
*/
public function scopeUnactivated($query)
{
return $query->where('is_activated', false);
}
/**
* Scope to filter activated keys
*/
public function scopeActivated($query)
{
return $query->where('is_activated', true);
}
}

View File

@@ -7,16 +7,20 @@ use Illuminate\Database\Eloquent\Model;
class Plan extends Model
{
protected $fillable = [
'name',
'description',
'product_id',
'pricing_id',
'price',
'mailbox_limit',
'monthly_billing',
'details'
'name',
'description',
'product_id',
'pricing_id',
'shoppy_product_id',
'accept_stripe',
'accept_shoppy',
'price',
'mailbox_limit',
'monthly_billing',
'details',
];
protected $casts = [
'details' => 'json',
'monthly_billing' => 'boolean',