/** * Delete a user * * @return json */ public function delete() { $id = Input::all()[0]; if ($this->users->count() == 1) { return $this->jsonResponse(400, false, 'You are the only user left in the application and cannot delete youself.'); } else { if (Auth::user()->id == $id) { return $this->jsonResponse(400, false, 'You are unable to delete yourself from the application.'); } else { $this->users->delete($id); return $this->jsonResponse(200, true, 'User has been successfully been deleted!'); } } }