/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index(Component $component) { $header = $component->where('type', 'header')->first(); $about = $component->where('type', 'about')->first(); $terms = $component->where('type', 'terms')->first(); $offers = $this->offers->orderBy('updated_at', 'desc')->get(); return view('welcome', compact('header', 'about', 'terms', 'offers')); }