38 lines
825 B
PHP
38 lines
825 B
PHP
<?php
|
|
|
|
namespace App\Livewire\Services;
|
|
|
|
use App\Livewire\Component;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Livewire\WithPagination;
|
|
|
|
class Index extends Component
|
|
{
|
|
use WithPagination;
|
|
|
|
public $status = null;
|
|
|
|
public function render()
|
|
{
|
|
$query = Auth::user()->services()
|
|
->with([
|
|
'product.category',
|
|
'product.server',
|
|
'plan',
|
|
'proxmoxServer',
|
|
])
|
|
->orderBy('created_at', 'desc');
|
|
|
|
if ($this->status) {
|
|
$query->where('status', $this->status);
|
|
}
|
|
|
|
return view('services.index', [
|
|
'services' => $query->paginate(config('settings.pagination')),
|
|
])->layoutData([
|
|
'title' => 'Services',
|
|
'sidebar' => true,
|
|
]);
|
|
}
|
|
}
|