Update source into github

This commit is contained in:
pbao9
2025-07-24 16:18:27 +07:00
parent 41419358dd
commit 69851ac7bc
2642 changed files with 284095 additions and 0 deletions
+68
View File
@@ -0,0 +1,68 @@
<?php
namespace App\Http\Livewire;
use App\Models\Invoice;
use App\Repositories\Invoice\InvoiceRepositoryInterface;
use Livewire\Component;
use Livewire\WithoutUrlPagination;
use Livewire\WithPagination;
class MyService extends Component
{
use WithPagination, WithoutUrlPagination;
public int|string $status = 'full';
public $type = '';
public $search = '';
protected $invoiceRepository;
public function mount(InvoiceRepositoryInterface $invoiceRepository)
{
$this->invoiceRepository = $invoiceRepository;
}
public function updatedSearch()
{
$this->resetPage();
}
public function updatedStatus()
{
$this->resetPage();
}
public function updatedType()
{
$this->resetPage();
}
public function render()
{
$query = Invoice::where('customer_id', customer()->id)
->with([
'invoiceItem.hosting',
'invoiceItem.vps',
'invoiceItem.os.osGroup',
'invoiceItem.addons.addonItems'
]);
// Filter by type if specified
if (!empty($this->type)) {
$query->whereHas('invoiceItem', function($q) {
$q->where('product_type', $this->type);
});
}
// Filter by server_name search if specified
if (!empty($this->search)) {
$query->whereHas('invoiceItem', function($q) {
$q->where('server_name', 'like', '%' . $this->search . '%');
});
}
return view('livewire.my-service', [
'services' => $query->orderBy('created_at', 'desc')->paginate(10)
]);
}
}