I have created a new custom field for Laravel Nova. In the component source file I have this method:
protected function fillAttributeFromRequest(NovaRequest $request,
$requestAttribute,
$model,
$attribute)
{
if ($request->exists($requestAttribute)) {
$model->{$attribute} = json_encode($request[$requestAttribute]);
}
}
Is there any way that I can get the resource ID after has been saved? Is there any afterSave method or something similar?