-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
- Laravel Version: 9.43.0
- Nova Version: 4.19.4
- PHP Version: 8.1.13
- Database Driver & Version: Sail mysql
- Operating System and Version: Sail
Description:
When you try to use $request->resourceId from an action fields, you get null when action is fired.
(on debuging, I get the resourceId on index or detail loading, but null when action is launched)
Detailed steps to reproduce the issue on a fresh Nova installation:
artisan nova:action CreateApiToken
public function fields(NovaRequest $request)
{
ray($request->resourceId);
ray()->showQueries();
return [
Text::make('Name')
->rules([
'required',
Rule::unique('personal_access_tokens', 'name')
->where('tokenable_id', $request->resourceId),
])
];
}My rule query was:
select
count(*) as aggregate
from
`personal_access_tokens`
where
`name` = 'test'
and `tokenable_id` is null // should be an ID not null
Metadata
Metadata
Assignees
Labels
No labels