Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't list files and Directories in shared folder #111

Open
Lamiter2016 opened this issue Jun 22, 2023 · 1 comment
Open

Don't list files and Directories in shared folder #111

Lamiter2016 opened this issue Jun 22, 2023 · 1 comment

Comments

@Lamiter2016
Copy link

Lamiter2016 commented Jun 22, 2023

I can create folder at shared folder betwen two accounts but I can't show the files and directories in that folder.
Plessea tell me where is wrong.
Laravel Framework 10.13.5
PHP 8.1.10
Route::get('list-files', function() { $recursive = false; // Get subdirectories also? $contents = collect(Storage::cloud()->listContents('/', $recursive)); dd($contents->where('type', 'dir')); return $contents->where('type', 'dir'); // directories // return $contents->where('type', 'file')->mapWithKeys(function($file) { // return [$file->path() => pathinfo($file->path(),PATHINFO_BASENAME)]; // }); });

@rildolho
Copy link

Route::get('list-files', function() {
            $recursive = false;
            // Get subdirectories also?
            $contents = collect(Storage::cloud()->listContents('/', $recursive));
            dd($contents->where('type', 'dir'));
            return $contents->where('type', 'dir');
            // directories
            // return $contents->where('type', 'file')->mapWithKeys(function($file) {
            //     return [$file->path() => pathinfo($file->path(),PATHINFO_BASENAME)];
            // });
        });

remove this:
dd($contents->where('type', 'dir'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants