Php 更改Laravel中的存储路径

Php 更改Laravel中的存储路径,php,laravel-4,Php,Laravel 4,是否可以更改到存储路径?我希望它位于生产环境中的存储库之外,以便部署正常工作 默认路径为app/storage/。我们正在使用4.1.x.是的,它是。您可以在bootstrap/path.php中定义它: /* |-------------------------------------------------------------------------- | Storage Path |----------------------------------------------------

是否可以更改到存储路径?我希望它位于生产环境中的存储库之外,以便部署正常工作


默认路径为
app/storage/
。我们正在使用4.1.x.

是的,它是。您可以在
bootstrap/path.php
中定义它:

/*
|--------------------------------------------------------------------------
| Storage Path
|--------------------------------------------------------------------------
|
| The storage path is used by Laravel to store cached Blade views, logs
| and other pieces of information. You may modify the path here when
| you want to change the location of this directory for your apps.
|
*/

'storage' => __DIR__.'/../app/storage',

不要忘记为新目录设置所需的读/写权限。

对于Laravel 5.0,您可以在bootstrap\app.php中完成此操作

$app->useStoragePath("/tmp/laravel_storage/");
希望这能帮助别人

编辑: 在Laravel 5.1中,这还不够