'api.dropdown.peminjaman', 'uses' => 'PeminjamanController@dropdown' // ]); Route::get('/api/dropdown/borrow/{id}', function ($id) { if (Request::ajax()) { //$category_id = Input::get('category_id'); // $books = Book::available()->orderByTitle()->where('category_id', '=', $id)->get(); $books = Dataset::OrderByType()->where('project_id', '=', $id)->get(); return Response::json($books); } });