public function isNotAvailable($bookClubId, $bookId) { // dd($this->borrowedBooks()->get()); $statusId = \App\BookStatus::where('name', 'Not Available')->first()->id; if ($this->booksInClubs()->where('book_club_id', $bookClubId)->where('book_id', $bookId)->where('status_id', $statusId)->get()->count()) { return true; } return false; }