/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { //only 4 exit; // delete $service = Service::find($id); $service->delete(); // redirect \Session::flash('message', 'Successfully deleted the service!'); return \Redirect::to('admin/services'); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $service_detail = Service_detail::find($id); // get the service $service = Service::find($service_detail->service_id); // delete $service_detail->delete(); // redirect \Session::flash('message', 'Successfully deleted the service_detail!'); return \Redirect::to("admin/service_details/{$service->id}"); }