$participantToken])->first(); if (null === $participant) { return response()->json(['message' => 'Participant not found'], 404); } $amount = $participant->amount; $amount->subtractAmount($participant->amount_paid); $girocodeProvider = new GiroCodeProvider( $participant->event()->first()->account_owner, $participant->event()->first()->account_iban, $participant->amount->getAmount(), $participant->payment_purpose ); return response($girocodeProvider->create(), 200, ['Content-Type' => 'image/png'] ); } }