| @@ 82-91 (lines=10) @@ | ||
| 79 | return redirect()->route('admin.services.new')->withInput(); |
|
| 80 | } |
|
| 81 | ||
| 82 | public function getService(Request $request, $service) |
|
| 83 | { |
|
| 84 | return view('admin.services.view', [ |
|
| 85 | 'service' => Models\Service::findOrFail($service), |
|
| 86 | 'options' => Models\ServiceOptions::select( |
|
| 87 | 'service_options.*', |
|
| 88 | DB::raw('(SELECT COUNT(*) FROM servers WHERE servers.option = service_options.id) as c_servers') |
|
| 89 | )->where('parent_service', $service)->get(), |
|
| 90 | ]); |
|
| 91 | } |
|
| 92 | ||
| 93 | public function postService(Request $request, $service) |
|
| 94 | { |
|
| @@ 218-224 (lines=7) @@ | ||
| 215 | return redirect()->route('admin.services.option', [$service, $option])->withInput(); |
|
| 216 | } |
|
| 217 | ||
| 218 | public function getNewVariable(Request $request, $service, $option) |
|
| 219 | { |
|
| 220 | return view('admin.services.options.variable', [ |
|
| 221 | 'service' => Models\Service::findOrFail($service), |
|
| 222 | 'option' => Models\ServiceOptions::where('parent_service', $service)->where('id', $option)->firstOrFail(), |
|
| 223 | ]); |
|
| 224 | } |
|
| 225 | ||
| 226 | public function postNewVariable(Request $request, $service, $option) |
|
| 227 | { |
|
| @@ 86-96 (lines=11) @@ | ||
| 83 | ]); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function listByService(Request $request, $id) |
|
| 87 | { |
|
| 88 | return view('admin.services.packs.byservice', [ |
|
| 89 | 'service' => Models\Service::findOrFail($id), |
|
| 90 | 'options' => Models\ServiceOptions::select( |
|
| 91 | 'service_options.id', |
|
| 92 | 'service_options.name', |
|
| 93 | DB::raw('(SELECT COUNT(id) FROM service_packs WHERE service_packs.option = service_options.id) AS p_count') |
|
| 94 | )->where('parent_service', $id)->get(), |
|
| 95 | ]); |
|
| 96 | } |
|
| 97 | ||
| 98 | public function new(Request $request, $opt = null) |
|
| 99 | { |
|