Add all files

This commit is contained in:
root
2025-11-30 11:57:22 +01:00
parent 2ee51cac4f
commit 044271db3d
1476 changed files with 142544 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Models;
use App\Models\Traits\HasPlans;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ConfigOption extends Model
{
use HasFactory, HasPlans;
protected $dontShowUnavailablePrice = true;
protected $fillable = [
'name',
'env_variable',
'type',
'sort',
'hidden',
'parent_id',
'upgradable',
];
/**
* Get the parent option.
*/
public function parent()
{
return $this->belongsTo(ConfigOption::class, 'parent_id');
}
/**
* Get the options that belong to the parent. (children or options)
*/
public function children()
{
return $this->hasMany(ConfigOption::class, 'parent_id')->orderBy('sort');
}
/**
* Get the products that belong to the option.
*/
public function products()
{
return $this->belongsToMany(Product::class, 'config_option_products');
}
/**
* Get the service configs that belong to the option.
*/
public function serviceConfigs()
{
return $this->hasMany(ServiceConfig::class, 'config_option_id');
}
}