How can I rename directory on public , In my controller ? I read Laravel document but File class doesn't have rename .
File::move();
I just need rename , I cant move my files to an other Folder
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
Storage::move('hodor/old-folder-name', 'hodor/new-cool-folder-name'); //rename folder
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