where('client_id', auth('contact')->user()->client->id) ->whereIn('status_id', [RecurringInvoice::STATUS_PENDING, RecurringInvoice::STATUS_ACTIVE, RecurringInvoice::STATUS_COMPLETED]) ->orderBy('status_id', 'asc') ->with('client') ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc') ->paginate($this->per_page); return render('components.livewire.recurring-invoices-table', [ 'invoices' => $query ]); } }