0

To move to a server, I overwrite the public_path() in App Providers using this code:

  public function register()
{
    $this->app->bind('path.public', function() {
      return base_path().'/public_html/img';
    });
}

But instead of getting

/home/domain/img/image.jpg 

I have

/Home/domain/laravelprojectname/public_html/img/image.jpg

Can someone help ? Thank you.

yassine j
  • 495
  • 1
  • 11
  • 27
  • This is because your app's code lives in `/Home/domain/laravelprojectname/public_html` on the server. What is the issue here, does the image not exist at the path? – 1000Nettles Feb 22 '19 at 00:22
  • i solved that by changing the code to return base_path().'/../public_html/img'; But still i dont understand why it's happened – yassine j Feb 22 '19 at 00:27
  • [Here](https://stackoverflow.com/questions/30198669/how-to-change-public-folder-to-public-html-in-laravel-5). – Tpojka Feb 22 '19 at 05:49

0 Answers0