Level 102
Never use env outside if config. It will return null if config is cached
Storage::disk(config('filesystems.system'))->getDriver()->getAdapter()->getPathPrefix()
//and config/filesystems.php
'system' => env('FILE_SYSTEM');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi I am using Laravel 5.1 and i am trying to get the storage path,
Storage::disk(env('FILE_SYSTEM'))->getDriver()->getAdapter()->getPathPrefix();
If FILE_SYSTEM = local, then its giving me correct path. but when i deploy the code on aws, where i am using s3 bucket, then replacing the FILE_SYSTEM = s3 is returning null.
I am unable to find out the actual issue. Please help.
Thanks in advance
Please or to participate in this conversation.