public function postContractorBan() { if (!($id = \Input::get('i')) || !($ban = \Input::get('ban'))) { return \Response::json(['type' => 'danger', 'message' => 'Data incomplete']); } try { \Contractor::banContractor($id, $ban); return \Response::json(['type' => 'success', 'message' => $ban === 'true' ? 'Contractor banned.' : 'Contractor unbanned.']); } catch (\Exception $e) { return \Response::json(['type' => 'danger', 'message' => $e->getMessage()]); } }