I'm using Laravel 5.0 Facades Storage
use Illuminate\Support\Facades\Storage;
and I can use it like
Storage::..
In the Laravel 5.0 Docs,there's nothing like rename a file or folder from the storage.
Any help, ideas, clues, suggestions, recommendations on how to rename a file or folder using the Storage?
You rename a directory by moving it to a different name. Use the mv command to rename directories. You can also use mv to move a directory to a location within another directory.
Use the mv command to move files and directories from one directory to another or to rename a file or directory.
You can rename directories using
Storage::rename('oldFolder/', 'newFolder/');
Laravel Docs
The move method may be used to rename or move an existing file to a new location:
Storage::move('hodor/file1.jpg', 'holdthedoor/file2.jpg');
this way, you can rename without moving
Storage::move('hodor/oldfile-name.jpg', 'hodor/newfile-name.jpg'); // keep the same folder to just rename
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With