create folder in upload request

This commit is contained in:
Čarodej
2022-02-23 08:26:16 +01:00
parent 0501e3e3d5
commit fdfb5f57d7
8 changed files with 113 additions and 25 deletions

View File

@@ -3,6 +3,7 @@
use Carbon\Carbon;
use ByteUnits\Metric;
use App\Users\Models\User;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Domain\Files\Models\File;
use Domain\Sharing\Models\Share;
@@ -27,6 +28,22 @@ if (! function_exists('isRunningCron')) {
}
}
if (! function_exists('getInnerFolderIds')) {
/**
* Get all folder children ids
*/
function getChildrenFolderIds(string $id): array
{
// Get folders within upload request
$folderWithinIds = Folder::with('folders:id,parent_id')
->where('parent_id', $id)
->get(['id']);
// Then get all accessible folders within
return Arr::flatten([filter_folders_ids($folderWithinIds), $id]);
}
}
if (! function_exists('obfuscate_email')) {
/**
* Obfuscate email