42 lines
908 B
PHP
42 lines
908 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class HostingPlan extends Model
|
|
{
|
|
protected $fillable = [
|
|
'slug',
|
|
'name',
|
|
'cpu',
|
|
'ram',
|
|
'disk',
|
|
'max_backups',
|
|
'allow_public_ip',
|
|
'allow_iso_upload',
|
|
'is_active',
|
|
'whmcs_product_id',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'cpu' => 'integer',
|
|
'ram' => 'integer',
|
|
'disk' => 'integer',
|
|
'max_backups' => 'integer',
|
|
'allow_public_ip' => 'boolean',
|
|
'allow_iso_upload' => 'boolean',
|
|
'is_active' => 'boolean',
|
|
'whmcs_product_id' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function customers(): HasMany
|
|
{
|
|
return $this->hasMany(Customer::class, 'hosting_plan_id');
|
|
}
|
|
}
|