Fix for client portal displaying entire companies invoices

This commit is contained in:
David Bomba 2020-06-10 23:33:53 +10:00
parent dda0df6b0f
commit 19f2475fb1

View File

@ -30,6 +30,7 @@ class InvoicesTable extends Component
public function render() public function render()
{ {
$query = Invoice::query() $query = Invoice::query()
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc'); ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc');
@ -48,7 +49,7 @@ class InvoicesTable extends Component
} }
$query = $query $query = $query
->where('company_id', auth('contact')->user()->company->id) ->where('client_id', auth('contact')->user()->client->id)
->paginate($this->per_page); ->paginate($this->per_page);
return render('components.livewire.invoices-table', [ return render('components.livewire.invoices-table', [