From afa5962596557effa38d1b3cf61d75b9aa02f2b0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 27 Nov 2025 09:18:42 +1100 Subject: [PATCH] Fixes for pushState and livewire conflicting use of prop --- app/Http/Controllers/ClientPortal/CreditController.php | 2 +- app/Http/Controllers/ClientPortal/InvoiceController.php | 2 +- app/Http/Controllers/ClientPortal/QuoteController.php | 2 +- app/Http/Controllers/VendorPortal/PurchaseOrderController.php | 2 +- phpstan.neon | 1 + resources/views/portal/ninja2020/credits/show.blade.php | 4 ++-- resources/views/portal/ninja2020/invoices/show.blade.php | 4 ++-- .../views/portal/ninja2020/purchase_orders/show.blade.php | 4 ++-- resources/views/portal/ninja2020/quotes/show.blade.php | 4 ++-- 9 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/ClientPortal/CreditController.php b/app/Http/Controllers/ClientPortal/CreditController.php index 94b0a267d2..e597c1b07b 100644 --- a/app/Http/Controllers/ClientPortal/CreditController.php +++ b/app/Http/Controllers/ClientPortal/CreditController.php @@ -36,7 +36,7 @@ class CreditController extends Controller $data = [ 'credit' => $credit, - 'key' => $invitation ? $invitation->key : false, + '_key' => $invitation ? $invitation->key : false, 'invitation' => $invitation ]; diff --git a/app/Http/Controllers/ClientPortal/InvoiceController.php b/app/Http/Controllers/ClientPortal/InvoiceController.php index 7330a6774f..79ae26f042 100644 --- a/app/Http/Controllers/ClientPortal/InvoiceController.php +++ b/app/Http/Controllers/ClientPortal/InvoiceController.php @@ -76,7 +76,7 @@ class InvoiceController extends Controller $data = [ 'invoice' => $invoice->service()->removeUnpaidGatewayFees()->save(), 'invitation' => $invitation ?: $invoice->invitations->first(), - 'key' => $invitation ? $invitation->key : false, + '_key' => $invitation ? $invitation->key : false, 'hash' => $hash, 'variables' => $variables, 'invoices' => [$invoice->hashed_id], diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 4d1a41787d..a0b1577604 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -59,7 +59,7 @@ class QuoteController extends Controller $data = [ 'quote' => $quote, - 'key' => $invitation ? $invitation->key : false, + '_key' => $invitation ? $invitation->key : false, 'invitation' => $invitation, 'variables' => $variables, ]; diff --git a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php index 5edf701cff..322a98f9c3 100644 --- a/app/Http/Controllers/VendorPortal/PurchaseOrderController.php +++ b/app/Http/Controllers/VendorPortal/PurchaseOrderController.php @@ -100,7 +100,7 @@ class PurchaseOrderController extends Controller $data = [ 'purchase_order' => $purchase_order, - 'key' => $invitation ? $invitation->key : false, + '_key' => $invitation ? $invitation->key : false, 'settings' => $purchase_order->company->settings, 'sidebar' => $this->sidebarMenu(), 'company' => $purchase_order->company, diff --git a/phpstan.neon b/phpstan.neon index e68999190d..0b2d3fd189 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -22,6 +22,7 @@ parameters: - 'app/Utils/Traits/*' - 'Modules/Accounting/*' - 'tests/*' + - '~/.cursor/*' universalObjectCratesClasses: - App\DataMapper\Tax\RuleInterface - App\DataMapper\FeesAndLimits diff --git a/resources/views/portal/ninja2020/credits/show.blade.php b/resources/views/portal/ninja2020/credits/show.blade.php index 1a870448d3..0ccf462e06 100644 --- a/resources/views/portal/ninja2020/credits/show.blade.php +++ b/resources/views/portal/ninja2020/credits/show.blade.php @@ -25,8 +25,8 @@ document.addEventListener('DOMContentLoaded', () => { - @if($key) - window.history.pushState({}, "", "{{ url("client/credit/{$key}") }}"); + @if($_key) + window.history.pushState({}, "", "{{ url("client/credit/{$_key}") }}"); @endif }); diff --git a/resources/views/portal/ninja2020/invoices/show.blade.php b/resources/views/portal/ninja2020/invoices/show.blade.php index a7a91a3e08..44f8f8625e 100644 --- a/resources/views/portal/ninja2020/invoices/show.blade.php +++ b/resources/views/portal/ninja2020/invoices/show.blade.php @@ -110,8 +110,8 @@ document.addEventListener('DOMContentLoaded', () => { - @if($key) - window.history.pushState({}, "", "{{ url("client/invoice/{$key}") }}"); + @if($_key) + window.history.pushState({}, "", "{{ url("client/invoice/{$_key}") }}"); @endif }); diff --git a/resources/views/portal/ninja2020/purchase_orders/show.blade.php b/resources/views/portal/ninja2020/purchase_orders/show.blade.php index 4767ee2160..9204a1dc73 100644 --- a/resources/views/portal/ninja2020/purchase_orders/show.blade.php +++ b/resources/views/portal/ninja2020/purchase_orders/show.blade.php @@ -53,8 +53,8 @@ document.addEventListener('DOMContentLoaded', () => { - @if($key) - window.history.pushState({}, "", "{{ url("vendor/purchase_order/{$key}") }}"); + @if($_key) + window.history.pushState({}, "", "{{ url("vendor/purchase_order/{$_key}") }}"); @endif }); diff --git a/resources/views/portal/ninja2020/quotes/show.blade.php b/resources/views/portal/ninja2020/quotes/show.blade.php index e57c748956..7e798e5a6e 100644 --- a/resources/views/portal/ninja2020/quotes/show.blade.php +++ b/resources/views/portal/ninja2020/quotes/show.blade.php @@ -89,8 +89,8 @@ document.addEventListener('DOMContentLoaded', () => { - @if($key) - window.history.pushState({}, "", "{{ url("client/quote/{$key}") }}"); + @if($_key) + window.history.pushState({}, "", "{{ url("client/quote/{$_key}") }}"); @endif });