chore: init saasshop repo + sql migrations runner + gitee go
This commit is contained in:
33
app/Models/Plan.php
Normal file
33
app/Models/Plan.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Plan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'code', 'name', 'billing_cycle', 'price', 'list_price', 'status', 'sort', 'description', 'settings', 'published_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'price' => 'decimal:2',
|
||||
'list_price' => 'decimal:2',
|
||||
'settings' => 'array',
|
||||
'published_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function subscriptions(): HasMany
|
||||
{
|
||||
return $this->hasMany(SiteSubscription::class);
|
||||
}
|
||||
|
||||
public function platformOrders(): HasMany
|
||||
{
|
||||
return $this->hasMany(PlatformOrder::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user