public function compose($view) { $frontend = new Fluent(); if (Auth::check()) { $frontend->user = new UserPresenter(Auth::user()); } $frontend->links = Cache::get('links', function () { $links = least('array', [Link::all()->toArray(), []]); Cache::put('links', $links, 60000); return $links; }); $view->with('frontend', $frontend); }
public function compose($view) { $frontend = new Fluent(); $frontend->links = least('array', Link::all()->toArray(), []); $view->with('frontend', $frontend); }