diff --git a/app/Http/Controllers/API/ServiceController.php b/app/Http/Controllers/API/ServiceController.php index aa8b4ac29..257ace766 100755 --- a/app/Http/Controllers/API/ServiceController.php +++ b/app/Http/Controllers/API/ServiceController.php @@ -55,6 +55,7 @@ class ServiceController extends BaseController 'options' => Models\ServiceOptions::select('id', 'name', 'description', 'tag', 'docker_image') ->where('parent_service', $service->id) ->with('variables') + ->with('packs') ->get(), ]; } diff --git a/app/Models/ServiceOptions.php b/app/Models/ServiceOptions.php index fe7e23f10..9b4a3a7ae 100644 --- a/app/Models/ServiceOptions.php +++ b/app/Models/ServiceOptions.php @@ -60,4 +60,14 @@ class ServiceOptions extends Model { return $this->hasMany(ServiceVariables::class, 'option_id'); } + + /** + * Gets all packs associated with this service. + * + * @return \Illuminate\Database\Eloquent\Relations\HasMany + */ + public function packs() + { + return $this->hasMany(ServicePack::class, 'option'); + } }