added crypto pm and activation key system
This commit is contained in:
46
app/Models/ActivationKey.php
Normal file
46
app/Models/ActivationKey.php
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user