Completed model updates for Services
This commit is contained in:
parent
09d23deed6
commit
323f1d943f
26 changed files with 299 additions and 167 deletions
|
@ -48,9 +48,29 @@ class ServiceOptions extends Model
|
|||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'parent_service' => 'integer',
|
||||
'service_id' => 'integer',
|
||||
];
|
||||
|
||||
/**
|
||||
* Gets service associated with a service option.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function service()
|
||||
{
|
||||
return $this->belongsTo(Service::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all servers associated with this service option.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function servers()
|
||||
{
|
||||
return $this->hasMany(Server::class, 'option_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all variables associated with this service.
|
||||
*
|
||||
|
@ -68,6 +88,6 @@ class ServiceOptions extends Model
|
|||
*/
|
||||
public function packs()
|
||||
{
|
||||
return $this->hasMany(ServicePack::class, 'option');
|
||||
return $this->hasMany(ServicePack::class, 'option_id');
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue