Reputation: 17
Based on the following link, we can use Laravel backpack fields on non-crud pages:
How to access backpack fields on custom (non-CRUD) page?
But what would be the correct way to pass model values to those?
Thanks in advance for any insight.
Upvotes: 0
Views: 459
Reputation: 17
Welp. Had a look at the source and figured it out. :)
Might be handy for someone looking for it.
Attribute 'Value'.
$model=User::find(1);
$crud->addField([
'name' => 'name',
'label' => 'Name',
'value' => $model->name
]);
Upvotes: 1