/**
  * Remove the specified Agent from storage.
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $agent = $this->agentRepository->find($id);
     if (empty($agent)) {
         Flash::error('Agent not found');
         return redirect(route('agents.index'));
     }
     $this->agentRepository->delete($id);
     Flash::success('Agent deleted successfully.');
     return redirect(route('agents.index'));
 }
 /**
  * Remove the specified Agent from storage.
  * DELETE /agents/{id}
  *
  * @param  int $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     $this->agentRepository->apiDeleteOrFail($id);
     return $this->sendResponse($id, "Agent deleted successfully");
 }