Exemplo n.º 1
0
 /**
  * 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'));
 }
Exemplo n.º 2
0
 public function index()
 {
     $works = new Works();
     $recent = $works->take(6)->orderBy('sort', 'asc')->latest('id')->get();
     return view('pages.home', compact('recent'));
 }