Binding nested data currently works for arrays. Would it be possible to allow nesting data with in eloquent model instance?
In my example below, I would like to be able to bind wire:model="contract_form.title"
or wire:model="contract_form.date
"
Obviously, I can make the eloquent model an array, but then I would lose the flexibility of using the instance in other methods (i.e. update()
)
ContractForm.php component
<?php
namespace App\Http\Livewire\Admin\Contracts;
use App\ContractForm;
use Livewire\Component;
class ViewContractForm extends Component
{
public $contract_form;
public function mount(ContractForm $contract_form)
{
$this->contract_form = $contract_form;
}
public function render()
{
return view('livewire.admin.contracts.view-contract-form');
}
}
I’m guessing the answer is no because it would add too much overhead, but I thought I would ask.
Thanks!