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

[9.x] Adds isDirectoryEmpty() and isDirectoryNotEmpty() to Filesystem #42559

Merged
merged 9 commits into from
May 31, 2022
Merged

[9.x] Adds isDirectoryEmpty() and isDirectoryNotEmpty() to Filesystem #42559

merged 9 commits into from
May 31, 2022

Conversation

DarkGhostHunter
Copy link
Contributor

@DarkGhostHunter DarkGhostHunter commented May 29, 2022

What?

Allows to check if a directory has files/directories or not. Even hidden ones.

use Illuminate\Support\Facades\File;

if (File::isDirectoryEmpty('john/photos')) {
    return 'You do not have any photos';
}

if (File::isDirectoryNotEmpty('john/videos', true)) {
    return 'You may have one or more videos, even hidden ones.';
}

BC?

Nope, just adding methods.

@DarkGhostHunter DarkGhostHunter changed the title [9.x] Adds hasFiles() and hasNoFiles() to Filesystem [9.x] Adds isDirectoryEmpty() and isDirectoryNotEmpty() to Filesystem May 30, 2022
@johanrosenson
Copy link
Contributor

Your examples are confusing, your returned strings doesn't match what you expect should happen.

@DarkGhostHunter DarkGhostHunter marked this pull request as draft May 30, 2022 04:36
@DarkGhostHunter
Copy link
Contributor Author

Your examples are confusing, your returned strings doesn't match what you expect should happen.

Fixed.

@DarkGhostHunter DarkGhostHunter marked this pull request as ready for review May 30, 2022 17:47
@taylorotwell taylorotwell merged commit 77ceefe into laravel:9.x May 31, 2022
@DarkGhostHunter DarkGhostHunter deleted the feat/file-dir-empty branch September 8, 2022 05:26
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

Successfully merging this pull request may close these issues.

3 participants