我的 Laravel 应用程序在私有文件夹中运行,我需要告诉 Laravel 公共路径是不同的。
今天我将 Laravel 应用程序从 4.2 升级到 5.0,但我找不到在哪里指定公共路径因为 paths.php 文件在 Laravel 5.0 中不再存在 https://github.com/laravel/laravel/commit/430134864642346498631ad562765d69599d6b39.
在 Laravel 4.2 中,我们有/bootstrap/paths.php
file:
/*
|--------------------------------------------------------------------------
| Public Path
|--------------------------------------------------------------------------
|
| The public path contains the assets for your web application, such as
| your JavaScript and CSS files, and also contains the primary entry
| point for web requests into these applications from the outside.
|
*/
'public' => __DIR__.'/../../../public_html',
我还没有使用 Laravel 5.0 文件夹结构,任何帮助将不胜感激。
对我来说完美的工作是添加public/index.php
以下三行:
$app->bind('path.public', function() {
return __DIR__;
});
这是在Laracast https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)