Laravel public folder on live server

Laravel public folder on live server

Hello everyone,

Sometimes when you take your laravel application from local to host (server) you might have issue with image/file(s) upload system in laravel and laravel instead of uploading your files to public_html will upload them in root folder and will create new folder usually named public.

To solve this issue and you be able to upload your files where they meant to be you need to edit your index.php under public folder and add these codes below into it.

 

// set the public path to this directory
$app->bind('path.public', function() {
    return __DIR__;
});

now save the file and enjoy uploading files in your laravel app.

Share:

Enjoy this?

Subscribe our newsletter and get latest updates straight to your inbox.