Storage::moveDirectory() not working as expected

Posted 2 years ago by dries

I would like to 'rename' a directory with Laravel. Since there is no rename method, I use the moveDirectory method in the Storage class.

There are two issues when I use this method:

  • The new directory gets created, but the original one doesn't get removed.
  • The contents of the original directory are not moved into the new one.

So for example

-- dir1
    - file

Storage::moveDirectory('dir1', 'dir2')

Results in:
-- dir1
    - file
-- dir2

What could be the issue here ?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.