mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 07:02:34 +01:00
ab8b05dd56
* Install livewire/livewire * Table improvements - Cleanup of InvoiceController - Added Livewire package - New Livewire component (InvoicesTable) - New WithSorting trait - Removed rendering invoices from index.blade.php - Removed Yaryabox/Datatables references in InvoiceController * Refactor: Recurring invoices * payments table & sorting improvements * payment methods table * quotes table * credits table * Add turbolinks
34 lines
904 B
PHP
34 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use App\Models\RecurringInvoice;
|
|
use App\Traits\WithSorting;
|
|
use Livewire\Component;
|
|
use Livewire\WithPagination;
|
|
|
|
class RecurringInvoicesTable extends Component
|
|
{
|
|
use WithPagination, WithSorting;
|
|
|
|
public $per_page = 10;
|
|
|
|
public function render()
|
|
{
|
|
$query = RecurringInvoice::query();
|
|
|
|
// ->whereClientId(auth()->user()->client->id) // auth()->user() null.
|
|
|
|
$query = $query
|
|
->whereIn('status_id', [RecurringInvoice::STATUS_PENDING, RecurringInvoice::STATUS_ACTIVE, RecurringInvoice::STATUS_COMPLETED])
|
|
->orderBy('status_id', 'asc')
|
|
->with('client')
|
|
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
|
|
->paginate($this->per_page);
|
|
|
|
return render('components.livewire.recurring-invoices-table', [
|
|
'invoices' => $query
|
|
]);
|
|
}
|
|
}
|