Laravel public folder on live server

Laravel public folder on live server

583

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.


- Last updated 4 years ago

Be the first to leave a comment.

You must login to leave a comment