flysystem-google-drive
flysystem-google-drive copied to clipboard
copy method doesn't return file (or file id)
The copy-method seems to be the only one that doesn't return the file you created. It's annoying because that way you can't save the file ID to a database. The cloud storage is also too slow to be able to right away find the file again in storage and get the file ID that way.
@rienheuver The return value of the copy method is defined as boolean.
However, you can get metadata using getMetaData() immediately after using the copy method.
if ($filesystem->copy($from, $to)) {
$metadata = $filesystem->getMetaData($to);
}
In the case i'm creating a folder like this
Storage::cloud()->makeDirectory('/' . $branch->BranchName);
how will I get the metadata ?
I need to get the directory ID