Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

realodix/urlhub

532 stars
2 code files
View realodix/urlhub on GitHub

app/Providers/HelperServiceProvider.php

Open in GitHub
use Illuminate\Support\ServiceProvider;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
 
class HelperServiceProvider extends ServiceProvider
{
public function boot()
{
$rdi = new RecursiveDirectoryIterator(app_path('Helpers'.DIRECTORY_SEPARATOR.'Global'));
$it = new RecursiveIteratorIterator($rdi);
 
while ($it->valid()) {
if (
! $it->isDot() &&
$it->isFile() &&
$it->isReadable() &&
$it->current()->getExtension() === 'php' &&
strpos($it->current()->getFilename(), 'Helper')
) {
require $it->key();
}
 
$it->next();
}
}
}

config/app.php

Open in GitHub
return [
//
'providers' => [
//
App\Providers\HelperServiceProvider::class,
//
],
//
];

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.