How can I hydrate FileUpload field with a URL
I tried this code but it didn't work
The image dose show in the table
The image dose show in the table
Forms\Components\FileUpload::make('image')
->afterStateHydrated(
function (FileUpload $component, Closure $get) {
if ($get('image_id')) {
$image = Image::find($get('image_id'))->with('storageLocation')->first();
$component->state([$image->storageLocation->host_name . '/' . $image->file_path]);
}
}
),