mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-11 19:03:46 +02:00
API model updates, as well as general model updates and code fixes.
This commit is contained in:
@@ -45,18 +45,11 @@ class ServiceController extends BaseController
|
||||
|
||||
public function view(Request $request, $id)
|
||||
{
|
||||
$service = Models\Service::find($id);
|
||||
$service = Models\Service::with('options.variables', 'options.packs')->find($id);
|
||||
if (! $service) {
|
||||
throw new NotFoundHttpException('No service by that ID was found.');
|
||||
}
|
||||
|
||||
return [
|
||||
'service' => $service,
|
||||
'options' => Models\ServiceOptions::select('id', 'name', 'description', 'tag', 'docker_image')
|
||||
->where('service_id', $service->id)
|
||||
->with('variables')
|
||||
->with('packs')
|
||||
->get(),
|
||||
];
|
||||
return $service->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user