Closed eugenem closed 6 months ago
Switch to the model through registration service provider. The old description does not have access to the current hasMany model and this method has not been supported for a long time. Example:
$hasMany = AdminForm::form()->addElement(
new FormElements(
[
AdminFormElement::hasMany('exam_results', [
AdminFormElement::image('image', 'Иконка')
->setUploadSettings([
'resize' => [600, null, function ($constraint)
{
$constraint->upsize();
$constraint->aspectRatio();
}],
])
->setAfterSaveCallback(function ($value, $model)
{
$model->image = $value;
$model->save();
}),
So when I try to use this image in the repeater:
settings
setimage
= uploads/c8cbae4cfbd81a7286b2209f34147f3f.jpg whereid
= 1