commerce = $commerce; } public function mount(): void { $this->workspace = Auth::user()?->defaultHostWorkspace(); } public function updatedStatus(): void { $this->resetPage(); } public function getInvoicesProperty(): LengthAwarePaginator { if (! $this->workspace) { return new \Illuminate\Pagination\LengthAwarePaginator([], 0, 10); } $query = $this->workspace->invoices() ->with('items') ->latest('issued_at'); if ($this->status !== 'all') { $query->where('status', $this->status); } return $query->paginate(10); } public function formatMoney(float $amount, ?string $currency = null): string { return $this->commerce->formatMoney($amount, $currency); } public function render() { return view('commerce::web.invoices', [ 'invoices' => $this->invoices, ]); } }