public function show($id) { $delight = Delight::with('customer')->find($id); if ($delight->account_id != Auth::user()->account_id) { return redirect('/dashboard/delights'); } return view('user.delights.show', compact('delight')); }
public function index() { $customers = Customer::where('account_id', Auth::user()->account_id)->get(); $delights = Delight::where('account_id', Auth::user()->account_id)->get(); if (count($customers) > 0) { return view('user.dashboard', compact('customers', 'delights')); } return view('user.blank-slate'); }