Friedrich's avatar

cPanel image upload

Can someone know how to upload image on laravel project in cPanel in my local it showed properly but in development the image wont showing i guess because of storage link was not recognizable by cPanel help me guys

0 likes
2 replies
Friedrich's avatar
Friedrich
OP
Best Answer
Level 1

First delete the storage folder inside your public folder. then go to your web.php then add this code:

Route::get('/storagelink',function(){
$targetFolder=$_SERVER['DOCUMENT_ROOT'].'/storage/app/public';
$linkFolder=$_SERVER['DOCUMENT_ROOT'].'/public/storage';
symlink($targetFolder,$linkFolder);
dd("Success");
});

LASTLY, type in your web url :

yourdomain.name/storagelink

then go back to your site done.

Please or to participate in this conversation.