has('payment_hash')) { $ph = PaymentHash::with('fee_invoice')->where('hash', $request->payment_hash)->first(); if ($ph) { auth()->guard('contact')->loginUsingId($ph->fee_invoice->invitations->first()->contact->id, true); } return $next($request); } abort(404, 'Unable to verify payment hash'); } }