public function getVerseText($bookName, $chapter, $verse) { $words = $this->getChapterText(Book::find($bookName)->konyv_id, $chapter); $words = $words->filter(function ($word) use($verse) { return $word->verse == $verse; }); return Response::json($words->values()); }
/** * @param Request $request * @param $bookId */ public function unBorrow(Request $request, $bookId) { $book = Book::find($bookId); $book->user()->dissociate(); $book->taken_at = null; $book->save(); Session::flash('info', 'Successfully'); return Redirect::to(route('book.index')); }