company->db); } public function render() { $query = Credit::query() ->where('client_id', auth('contact')->user()->client->id) ->where('status_id', '<>', Credit::STATUS_DRAFT) ->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc') ->paginate($this->per_page); return render('components.livewire.credits-table', [ 'credits' => $query, ]); } }