notifications; foreach ($notifications as $notification) { if ($notification->id == $notificationId) { $notification->delete(); return redirect()->to($notification->data["referral"]); } } return back(); } }