fileupload issue preview issue

i have set APP_URL=http://127.0.0.1:8000 in .env and i have also done php artisan storage:link And uploading image like this
FileUpload::make('kheltag_profile_image')
->label("Upload Profile Image")
->image()
->disk('local')
->afterStateHydrated(function ($record, $component) {
if ($record && $record->termmeta->where('meta_key', "kheltag_profile_image")->first()?->meta_value) {
return $component->state([$record->termmeta->where('meta_key', "kheltag_profile_image")->first()?->meta_value]);
}
}),
FileUpload::make('kheltag_profile_image')
->label("Upload Profile Image")
->image()
->disk('local')
->afterStateHydrated(function ($record, $component) {
if ($record && $record->termmeta->where('meta_key', "kheltag_profile_image")->first()?->meta_value) {
return $component->state([$record->termmeta->where('meta_key', "kheltag_profile_image")->first()?->meta_value]);
}
}),
but while previewing i am getting this error 404 not found error
11 Replies
Dennis Koch
Dennis Koch2y ago
What's the result of $record->termmeta->where('meta_key', "kheltag_profile_image")->first()?->meta_value?
ba_mbi_07
ba_mbi_07OP2y ago
"Xwb5YjKKqfln32d3bP0AFBBmqn8JW9-metaU2NyZWVuc2hvdCBmcm9tIDIwMjMtMDUtMTggMTMtMzYtNTUucG5n-.png" this is the result
Dennis Koch
Dennis Koch2y ago
Btw. you are using local disk and not public 🤔
ba_mbi_07
ba_mbi_07OP2y ago
->disk ('public') not making any difference too using disk or not...not doing any difference also...i am getting 404 not found error
Dennis Koch
Dennis Koch2y ago
And that file exists in storage/app/public ?
ba_mbi_07
ba_mbi_07OP2y ago
yes "6CAuRmwtXPZw6164TnxVGfddpKLwql-metaU2NyZWVuc2hvdCBmcm9tIDIwMjMtMDUtMDIgMTAtMDctMDEucG5n-.png" this image i uploaded last time
ba_mbi_07
ba_mbi_07OP2y ago
this is also in the public folder
Dennis Koch
Dennis Koch2y ago
What OS and Dev environment are you using?
ba_mbi_07
ba_mbi_07OP2y ago
ubuntu and local environment
Dennis Koch
Dennis Koch2y ago
Does readlink public/storage return the correct path?
ba_mbi_07
ba_mbi_07OP2y ago
i think path is being mismatched...after removing srorage: link i again reconnected...it worked Thank you
Want results from more Discord servers?
Add your server