Monday, 7 October 2019

Editing after saving doesn't show selected input

I'm using the Backpack for Laravel CRUD features & currently having an issue with the select field type as to which after saving the form, once I go back to try and edit it isn't pre-defining my selected option?

Here's my setup() code inside my Accounts controller:

$this->crud->setModel("App\Models\Accounts");
$this->crud->setRoute("admin/accounts");
$this->crud->setEntityNameStrings('Accounts', 'Account');

$this->crud->addField([
    'label' => "Proxy",
    'type' => 'select',
    'name' => 'proxy_id',
    'entity' => 'proxy',
    'attribute' => 'id',
    'model' => "App\Models\Proxies"
]);

And here's my proxy() entity within the Proxies model:

public function proxy()
{
    return $this->hasOne(Proxies::class, 'id', 'proxy_id');
}


from Editing after saving doesn't show selected input

No comments:

Post a Comment