Created
March 12, 2018 19:59
-
-
Save kevinruscoe/ec83313d5713bb0dd19a8828c6e0cf4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| | |
| Here is where you can register web routes for your application. These | |
| routes are loaded by the RouteServiceProvider within a group which | |
| contains the "web" middleware group. Now create something great! | |
| | |
*/ | |
Route::get('/', function () { | |
$files = collect(\Storage::allFiles('public')); | |
dd($files->inFolder('public/test')); | |
}); | |
\Illuminate\Support\Collection::macro('inFolder', function ($folder) { | |
return $this->filter(function ($value) use ($folder) { | |
return starts_with($value, $folder); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment