public function authors(Request $request) { $list = $request->has('list'); $limit = $this->getLimit($request); if ($list) { $authors = Author::orderBy('name')->lists('name'); return $this->response()->item($authors, function ($authors) { return $authors; }); } $authors = Author::orderBy('name')->paginate($limit); return $this->response()->paginator($authors, new AuthorTransformer()); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $authors = Author::orderBy('name')->paginate(100); return view('author.index', compact('authors')); }