У меня проблемы с кодом для загрузки файлов на диск Google, когда я использую пакет nao-pon/flysystem-google-drive
, этот код будет создан text.txt to subdirectory = "Contract", но у меня много папок с разными именами, и они являютсяТе же 2 папки Дети: Контракт, Проект.Я не могу найти способ создать text.txt
в нужном имени папки
Я пытался исправить запрос в
$dir = $contents->where('type', '=', 'dir')
->where('filename', '=', 'Contract')
->first();
, но он не работает.
Route::get('put-in-dir', function() {
$dir = '/';
$recursive = true; // Get subdirectories also?
$contents = collect(Storage::cloud()->listContents($dir, $recursive));
$dir = $contents->where('type', '=', 'dir')
->where('filename', '=', 'Contract')
->first(); // There could be duplicate directory names!
if ( ! $dir) {
return 'Directory does not exist!';
}
Storage::cloud()->put($dir['path'].'/test.txt', 'Hello World');
return 'File was created in the sub directory in Google Drive';
});
Я хочу создать text.txt в Forder, я хочу.Пример: я хочу создать в контракте Ясуо ..
Shaco-
--Contract
--Project
Yasuo-
--Contract
--Project