0

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.

Gustavo Silva
  • 17
  • 1
  • 5

1 Answers1

1

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
]);
Gustavo Silva
  • 17
  • 1
  • 5