/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $keyword = Input::get('keyword'); if (!$keyword) { $books = Books::orderBy('title', 'ASC')->get(); } else { $books = Books::where('title', 'like', '%' . $keyword . '%')->orWhere('author', 'like', '%' . $keyword . '%')->get(); } return view('catalog.index', compact('books'))->with('result', 'OK'); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $books = Books::where('record_id', NULL)->orderBy('title', 'ASC')->get(); return view('books.index', compact('books')); }