Level 1
up
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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
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.