public function getAppliedAttribute() { if (Session::has('user_id')) { return CompanyApplyJob::where('job_id', '=', $this->id)->where('user_id', '=', Session::get('user_id'))->whereNotIn('status', [1, 2])->count(); } return 0; }
public function applicantPermanentReject($applicant_id) { try { if (CompanyApplyJob::where('id', '=', $applicant_id)->delete()) { return true; } return false; } catch (Exception $e) { return Response::json(['error' => $e->getMessage()]); } }