initial: bootstrap from BukidBountyApp base
This commit is contained in:
45
app/Models/Subscription/SubscriptionPlan.php
Normal file
45
app/Models/Subscription/SubscriptionPlan.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models\Subscription;
|
||||
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
use App\Models\User;
|
||||
|
||||
class SubscriptionPlan extends Model
|
||||
{
|
||||
protected ?string $table = 'subscription_plans';
|
||||
|
||||
public bool $incrementing = true;
|
||||
|
||||
protected array $fillable = [
|
||||
'hashkey',
|
||||
'name',
|
||||
'description',
|
||||
'price',
|
||||
'duration_days',
|
||||
'expiry_action',
|
||||
'active',
|
||||
'additional_details',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
protected array $casts = [
|
||||
'active' => 'boolean',
|
||||
'price' => 'float',
|
||||
'duration_days' => 'integer',
|
||||
'additional_details' => 'array',
|
||||
];
|
||||
|
||||
public function subscriptions()
|
||||
{
|
||||
return $this->hasMany(Subscription::class, 'plan_id');
|
||||
}
|
||||
|
||||
public function creator()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user