public function index() { return view('website.index')->with('categories', Category::orderBy('position', 'ASC')->get())->with('works', Work::orderBy('position', 'ASC')->get())->with('homeWorks', Work::where('display_home', true)->orderBy('position', 'ASC')->get()); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $works = Work::orderBy('created_at', 'DESC')->take(3)->get(); $posts = Post::orderBy('created_at', 'DESC')->take(3)->get(); return view('index', compact(['works', 'posts'])); }