Hi, i crop and upload the image fine and it's shown right in index and details page. But when edit a row, the image is not shown. See my code:
ImageCropper::make('Avatar', 'avatar')
->disk('my_custom_disk')
->path('images/usuarios/'.str_pad($this->id, 10, "0", STR_PAD_LEFT))
->preview(function () {
if (!$this->value) return null;
$url = Storage::disk($this->disk)->url($this->value);
$filetype = pathinfo($url)['extension'];
return 'data:image/' . $filetype . ';base64,' . base64_encode(file_get_contents($url));
})->avatar(),
I think it's a good idea to preview the image when editing too... but only update it when user re-crops the image, upload & crop a new image.
Hi, i crop and upload the image fine and it's shown right in index and details page. But when edit a row, the image is not shown. See my code:
I think it's a good idea to preview the image when editing too... but only update it when user re-crops the image, upload & crop a new image.