1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Refactor for livewire

This commit is contained in:
David Bomba 2022-12-23 11:39:41 +11:00
parent d4356af782
commit 3a85441c49
2 changed files with 12 additions and 5 deletions

View File

@ -13,6 +13,7 @@
namespace App\Http\Livewire;
use App\Libraries\MultiDB;
use App\Models\Company;
use App\Models\Invoice;
use App\Utils\Traits\WithSorting;
use Carbon\Carbon;
@ -23,15 +24,21 @@ class InvoicesTable extends Component
{
use WithPagination, WithSorting;
public $per_page = 10;
public int $per_page = 10;
public $status = [];
public array $status = [];
public $company;
public Company $company;
public int $company_id;
public string $db;
public function mount()
{
MultiDB::setDb($this->company->db);
MultiDB::setDb($this->db);
$this->company = Company::find($this->company_id);
$this->sort_asc = false;

View File

@ -23,6 +23,6 @@
</form>
</div>
<div class="flex flex-col mt-4">
@livewire('invoices-table', ['company' => $company])
@livewire('invoices-table', ['company_id' => $company->id, 'db' => $company->db])
</div>
@endsection