22 lines
483 B
PHP
22 lines
483 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||
|
|
|
||
|
|
class Plan extends Model
|
||
|
|
{
|
||
|
|
protected $fillable = ['code', 'name', 'price_cents', 'period', 'description', 'sort', 'status'];
|
||
|
|
|
||
|
|
protected function casts(): array
|
||
|
|
{
|
||
|
|
return ['price_cents' => 'integer', 'sort' => 'integer'];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function entitlements(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(PlanEntitlement::class);
|
||
|
|
}
|
||
|
|
}
|