/** * Remove the specified resource from storage. * DELETE /services/{id} * * @param int $id * @return Response */ public function destroy($id) { Service::findOrFail($id)->delete(); Flash::message('Service Deleted!'); return Redirect::route('services')->with('Flash_message', 'Service Deleted'); }
/** * Update the specified service in storage. * * @param int $id * @return Response */ public function updateService($id) { $service = Service::findOrFail($id); $detail = Input::only('highlights', 'summary'); $condition = Input::only('special_condition', 'condition1', 'condition2'); $data = Input::except('highlights', 'summary', 'special_condition', 'condition1', 'condition2'); $validator = Validator::make($data, Service::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } ServiceDetail::where('id', (int) $data['detail_id'])->update($detail); ServiceCondition::where('id', (int) $data['condition_id'])->update($condition); $service->update($data); return Redirect::route('admin.services.index'); }
/** * Display the specified service. * * @param int $id * @return Response */ public function showService($id) { $service = Service::findOrFail($id); return View::make('site.services.show', compact('service')); }
/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { return View::make('services.update')->with('service', Service::findOrFail($id))->with('title', 'Edit Service'); }