Laravel 5 change public_path()

后端 未结 6 1072
南方客
南方客 2020-11-27 12:26

I am trying to move the public folder to other place. However, I can\'t find the place to modify public_path() variable. Now, the \'public_path()\'

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-27 12:47

    You can override the public path using ioc container :

    What worked for me flawlessly was adding to public/index.php the following three lines:

     $app->bind('path.public', function() {
        return __DIR__;
    });
    

    For more detailed explanation click here

提交回复
热议问题