update = $updateService; $this->location = $locationRepository; } public function updateLocations() { $result = $this->update->data(); return back()->with( 'message', $result ); } public function compileLocations() { $result = $this->update->list(); return back()->with( 'message', $result ); } public function editLocation(Request $request) { $token = csrf_token(); $response = $this->location->editLocation($request); if ($response['status']) { return back()->with('message', $response['message']); } else { return back()->withErrors('message', $response['message']); } } }