/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $works = Works::take(10)->orderBy('sort', 'asc')->latest('created_at')->paginate(10); return view('admin.index', compact('works')); }
public function index() { $works = new Works(); $recent = $works->take(6)->orderBy('sort', 'asc')->latest('id')->get(); return view('pages.home', compact('recent')); }