Developers. I am working on an API project and there is image uploading in many pages, and I was storing the images like this
public function store(StorePlatformRequest $request)
{
$request->validated($request->all());
$filePath = $request->file('logo')->store('platforms_logos', 'public');
$platform = Platform::create([
'name' => $request->name,
'logo' => Storage::url($filePath),
]);
return new PlatformResource($platform);
}
and for example the logo image field in the database is storing a value like this
/storage/platforms_logos/wg3p4shWA3C9GGDEca4fDFSezVNn5eNWZsaD45HO.png
Now I uploaded my project on a shared hosting and the old images that was uploaded when I was working on local is retrieving successfully and working fine because I changed the localhost URL in the frontend pages to retrieve the links from the deployed app
But somehow when I am calling any function that includes image uploading it’s not working, the image is uploaded successfully in the storage/app/public folders and the name of it is stored in the database, but I can’t retrieve it anymore.
Can any one help me with what I am missing?