You can store anywhere as long as the folder has proper permissions, I use a folder called
laravel58\assets\upload
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am currently trying to find a way to change laravels storage path (for the whole storage folder) to a custom one (e.g. /my/custom/storage_folder). The first way (using AppServiceProvider) seems to have worked in the past (according to other online posts), but is not fully working anymore.
public function register() {
$this->app->useStoragePath(config('filesystems.storage_path'));
}
the following happens:
Using this way,
Storage::disk('local')->getAdapter()->getPathPrefix();
returns " /var/www/mywebsite/storage". (The disks root is set to storage_path() in the filesystems config file.)
$app->useStoragePath("/my/custom/storage_folder");
laravel uses the right storage path for everything, but this way is not very nice, because it is not possible to get the storage path from one of the config files/the environment file.
Does anyone know a solution? Thankful for all help!
Please or to participate in this conversation.