How to fix undefined method File::hashName() in Laravel Storage putFile()

Photo by Sung Jin Cho on Unsplash

In an app that I’m currently working on, I need to copy some large files from local disk over to DigitalOcean Spaces everyday after processing. Because the files are quite large, I need to do it via streaming instead or I will exhaust my VPS’s memory.

Following Laravel’s documentation, I have some codes that look like this: