API model updates, as well as general model updates and code fixes.
This commit is contained in:
parent
8dc1f41b73
commit
32a1dc17ed
16 changed files with 162 additions and 272 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue