Last active
March 28, 2019 13:52
-
-
Save driesvints/6784886 to your computer and use it in GitHub Desktop.
Laravel Weekly #25 Quick Tip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get an array of all files in a directory. | |
$files = File::files('path_to_dir'); | |
// Get all of the files from the given directory (recursive). | |
$files = File::allFiles('path_to_dir'); | |
// Get all of the directories within a given directory. | |
$files = File::directory('path_to_dir'); | |
// Copy a directory from one location to another. | |
File::copyDirectory('path_to_dir', 'destination'); | |
// Recursively delete a directory. | |
File::deleteDirectory('path_to_dir'); | |
// Empty a directory of all contents while preserving the directory itself. | |
File::cleanDirectory('path_to_dir'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment