Open eman-abdulwahab opened 4 years ago
I have tried the following, yet does not appear to work (But it does work on regular BelongsTo
field).
NovaBelongsToDepend::make('User', 'user', User::class)
->options(UserModel::all())
->withMeta([
'belongsToId' => $request->user()->id,
]),
However, found this in another issue, which for some reason works:
$userId = $request->user()->id;
NovaBelongsToDepend::make('User', 'user', User::class)
->options(UserModel::all())
->withMeta([
'value' => $userId,
'valueKey' => $userId,
]),
Hey, Not an issue, but is there a way to predefine a selected id? I want to load all values and have the value for the user be selected by default.