API model updates, as well as general model updates and code fixes.

This commit is contained in:
Dane Everitt 2017-02-10 20:26:38 -05:00
parent 8dc1f41b73
commit 32a1dc17ed
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
16 changed files with 162 additions and 272 deletions

View file

@ -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();
}
}