33 lines
760 B
PHP
33 lines
760 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use App\Models\Invoice as CustomerInvoice;
|
|
use Livewire\Component;
|
|
use Livewire\WithPagination;
|
|
|
|
class Invoice extends Component
|
|
{
|
|
use WithPagination;
|
|
public $status = "full";
|
|
|
|
public function render()
|
|
{
|
|
|
|
return view('livewire.invoice', [
|
|
'invoice' => CustomerInvoice::where(function ($query) {
|
|
switch ($this->status) {
|
|
case "0":
|
|
case "1":
|
|
case "2":
|
|
$query->where('status', $this->status);
|
|
break;
|
|
}
|
|
})
|
|
->where('customer_id', customer()->id)
|
|
->latest()
|
|
->paginate(10)
|
|
]);
|
|
}
|
|
}
|