From 6a991aa3209ee04fa70e6b8444d843ec33c8905c Mon Sep 17 00:00:00 2001 From: Stan Menten Date: Wed, 18 Dec 2024 16:46:28 +0100 Subject: [PATCH] Changed package name in invoice pdf --- app/Http/Controllers/Profile/ProfileBillingController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Profile/ProfileBillingController.php b/app/Http/Controllers/Profile/ProfileBillingController.php index 783f5c5..504d0eb 100644 --- a/app/Http/Controllers/Profile/ProfileBillingController.php +++ b/app/Http/Controllers/Profile/ProfileBillingController.php @@ -208,9 +208,14 @@ class ProfileBillingController extends Controller public function pdf(Request $request, $id) { + $invoice = $request->user()->findInvoice($id); + $planId = $invoice->lines->data[0]->plan->id; + + $plan = Package::query()->where('stripe_plan_id', $planId)->first(); + return $request->user()->downloadInvoice($id, [ 'vendor' => setting('name'), - 'product' => 'Webhosting', + 'product' => $plan->name, ]); }