24 lines
694 B
PHP
24 lines
694 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class NasPackageProfile extends Model
|
|
{
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['price' => 'decimal:2', 'service_parameters' => 'array', 'dns_servers' => 'array', 'mac_lock_required' => 'boolean'];
|
|
}
|
|
|
|
public function tenant()
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
|
|
public function targets() { return $this->hasMany(NasPackageProfileTarget::class); }
|
|
public function scripts() { return $this->belongsToMany(NasScriptPolicy::class, 'nas_package_profile_scripts')->withPivot(['event', 'nas_script_policy_version_id', 'enabled']); }
|
|
}
|