Laravel 5 如何更改默认路径'/公共';拉威尔的名字
我的服务器使用cPanel。这里的目录结构Laravel 5 如何更改默认路径'/公共';拉威尔的名字,laravel-5,Laravel 5,我的服务器使用cPanel。这里的目录结构 拉维尔项目 公共图书馆 公共网页 公开的 index.php 我在服务器上部署了这个家伙 一切正常,但我的基本路径是“mydomain.com/public” 我不想从我的路径中删除/public,但要更改它, 我想要这样的路径“mydomain.com/noted” 我正在使用laravel 5.3版 有什么想法吗? 感谢您更改公用文件夹中的index.php * |-----------------------------------
- 拉维尔项目
- 公共图书馆
- 公共网页
- 公开的
- index.php
- 公开的
index.php
*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
});
现在,当您的公共路径
目录已更改
Elixir有一个硬编码的公共路径!不要忘记设置已更改的参数
Elixir配置中的公共路径
我可能会补充说,您还需要确保新的公共路径具有与默认路径相同的权限。您可能还想更改laravel 5.6中config/filesystem.php
中的公共路径,将此代码添加到bootstrap/app.php:
$app->bind('path.public', function() {
return realpath(__DIR__.'/../');
});
其中,\uuuuuu DIR\uuuuu./../'是您的公用文件夹的路径我使用asset()包含来自js/css的源代码,然后全部消失。我遵循这一点,并将asset()更改为elixir()仍然无法工作我的XAMMP有一个问题,但生产仍然正常谢谢:D