/**
  * 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.");
 }
Ejemplo n.º 2
0
 /**
  * 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');
 }
Ejemplo n.º 3
0
 /**
  * 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');
 }
Ejemplo n.º 4
0
 /**
  * @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);
 }