Blade scaffolding with Laravel Breeze#1 - 05:21
Cleaning up unused old records and files in Laravel applications#2 - 06:22
Get all files except specific paths in Laravel#3 - 09:41
Authenticate mobile applications with Laravel Sanctum#4 - 21:22
Verify user emails in a Laravel REST API#5 - 14:39
The only reasonable, cost-effective way to test validation in Laravel applications#6 - 06:53
Setup live reload with Laravel mix and BrowserSync#7 - 03:49
Get all files except specific paths in Laravel
Recently I found myself in need of filtering out some paths when grabbing all the files using the File facade.
Those paths that need to be excluded can be specific files or specific directories. So we need to support both.
To save us from repeating the filtering logic everywhere, we can setup a macro.
Laravel macros allow us to add custom functionality to existing Laravel components. In our case, the File facade.
We can register a macro inside the Appservice provider, under the boot method.