From 19f2475fb1fde8273137d3c4e186ef279f55f805 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 10 Jun 2020 23:33:53 +1000 Subject: [PATCH] Fix for client portal displaying entire companies invoices --- app/Http/Livewire/InvoicesTable.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Livewire/InvoicesTable.php b/app/Http/Livewire/InvoicesTable.php index 5ed20a85b1d9..9cfe333c8bc4 100644 --- a/app/Http/Livewire/InvoicesTable.php +++ b/app/Http/Livewire/InvoicesTable.php @@ -30,6 +30,7 @@ class InvoicesTable extends Component public function render() { + $query = Invoice::query() ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc'); @@ -48,7 +49,7 @@ class InvoicesTable extends Component } $query = $query - ->where('company_id', auth('contact')->user()->company->id) + ->where('client_id', auth('contact')->user()->client->id) ->paginate($this->per_page); return render('components.livewire.invoices-table', [