sortBy === $column) {
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
} else {
$this->sortBy = $column;
$this->sortDirection = 'asc';
}
}
#[On('invoice-created')]
public function refresh(): void {}
#[Computed]
public function invoices()
{
return Invoice::orderBy($this->sortBy, $this->sortDirection)->paginate(10);
}
};
?>
Invoice Number
Client
Status
Invoice Date
Sent
Due Date
Total
@foreach($this->invoices as $invoice)
{{ $invoice->invoice_number }}
{{ $invoice->client->abbreviation }}
{{ $invoice->status->label() }}
{{ $invoice->invoice_date?->format('m/d/Y') }}
@if($invoice->sent_at)
{{ $invoice->sent_at->format('m/d/Y') }}
@elseif($invoice->status === InvoiceStatus::POSTED)
Not Sent
@endif
@if($invoice->due_date)
{{ $invoice->due_date?->format('m/d/Y') }}
@endif
{{ formatMoney($invoice->total) }}
Edit Invoice
Customer Invoice
@endforeach