kalle
03/10/2023, 11:27 AMNechalon
03/10/2023, 11:27 AMkalle
03/10/2023, 11:29 AMNechalon
03/10/2023, 11:29 AMNechalon
03/10/2023, 11:30 AMNechalon
03/10/2023, 11:30 AMNechalon
03/10/2023, 11:32 AMgetUserEmail
and call that? 😄kalle
03/10/2023, 11:35 AMformData
and that model/resolved query will be availble in the forms.
php
/*
* Add anything you would like to have available in your module's form view
* For example, relationship lists for multiselect form fields
*/
protected function formData($request)
{
// Here make your query
return [
'model' => Model::getUserEmail(),
];
}
And in your form.blade.php you can access it by variable $model
.Nechalon
03/10/2023, 11:40 AMUndefined variable $model
kalle
03/10/2023, 11:43 AMformData
in the same module controller?Nechalon
03/10/2023, 11:43 AM'model' => 'test',
kalle
03/10/2023, 11:50 AM@dd($item)
in the form.kalle
03/10/2023, 11:51 AMNechalon
03/10/2023, 11:53 AM$item->id
it still doesnt display it, only if I do 'id'
, any idea why?kalle
03/10/2023, 11:57 AMifox
03/10/2023, 11:59 AMkalle
03/10/2023, 12:00 PMNechalon
03/10/2023, 12:02 PMNechalon
03/10/2023, 12:03 PMifox
03/10/2023, 12:03 PMNechalon
03/10/2023, 12:03 PM'name' => $item->id,
ifox
03/10/2023, 12:04 PMifox
03/10/2023, 12:05 PMNechalon
03/10/2023, 12:05 PMifox
03/10/2023, 12:10 PMUser::find($item->id)
sounds like what you're looking for in that caseNechalon
03/10/2023, 12:12 PMname
field?kalle
03/10/2023, 12:15 PMname
is reserved as a reference to the Vuex store, so when component are loaded, form inputs by that name
get data to input values. You may be looking for label
in your case?Nechalon
03/10/2023, 12:16 PMifox
03/10/2023, 12:16 PMifox
03/10/2023, 12:16 PMgetFormFields