1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 00:41:34 +02:00
invoiceninja/app/Http/Livewire/PaymentsTable.php
Benjamin Beganović ab8b05dd56
Client portal improvements (#3652)
* 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
2020-04-23 08:49:23 +10:00

35 lines
692 B
PHP

<?php
namespace App\Http\Livewire;
use App\Models\Payment;
use App\Traits\WithSorting;
use Livewire\Component;
use Livewire\WithPagination;
class PaymentsTable extends Component
{
use WithSorting;
use WithPagination;
public $per_page = 10;
public $user;
public function mount()
{
$this->user = auth()->user();
}
public function render()
{
$query = Payment::query()
->with('type', 'client')
->orderBy($this->sort_field, $this->sort_asc ? 'asc' : 'desc')
->paginate($this->per_page);
return render('components.livewire.payments-table', [
'payments' => $query
]);
}
}