Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

timpackwood87's avatar

Storage::put - to a specific directory

Hi All

Trying to generate a PDF using DOMPDF and then save it to a certain directory on my app.

Is it possible to specify a sub directory to store the file as part of the Storage::put method?

Storage::Put($name, $cotent) 

The above defaults to Storage/App, but is it possible to store it in a specific folder such Storage/App/Folder1 dynamically rather than specifying it in the settings.

Thanks in advance.

Tim

0 likes
1 reply
goatshark's avatar

Hey @timpackwood87 I think you can just feed the path into $name. You could

Storage::put('folder/folder/'.$name, $content);

Or set the path relative to storage/app before that

$full_path = 'folder/folder/' . $name;
Storage::put($full_path, $content);

2 likes

Please or to participate in this conversation.