/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $state = State::findOrFail($id); $state->lgas()->delete(); $state->delete(); return redirect('/admin/location')->withSuccess("The location '{$state->name}' has been deleted."); }
/** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { $state = State::findOrFail($id); $state->delete(); return redirect('state'); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $state = State::findOrFail($id); $state->delete(); return redirect()->route('settings.state.index'); }
/** * @param $all * @return array */ private function handleStateAnalytics($all) { $subcomponent = $all['subcomponents']; $state = State::findOrFail($all['state']); $zones = $state->zone; $repairshops = collect(); foreach ($zones as $zone) { $shops = $zone->repairshop; $repairshops = $repairshops->merge($shops); } return $this->returnAnalysis($repairshops, $subcomponent, 'state', $state); }