25 lines
597 B
PHP
Executable File
25 lines
597 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class SubscriptionPlan extends Model
|
|
{
|
|
protected $fillable = ['name', 'description', 'price', 'currency', 'duration_days', 'token_limit', 'is_active'];
|
|
|
|
protected $casts = [
|
|
'price' => 'decimal:2',
|
|
'duration_days' => 'integer',
|
|
'token_limit' => 'integer',
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function userSubscriptions(): HasMany
|
|
{
|
|
return $this->hasMany(UserSubscription::class);
|
|
}
|
|
} |