Skip to content

Instantly share code, notes, and snippets.

@prinsss
Created November 1, 2016 06:42
Show Gist options
  • Save prinsss/8b3632231a999a2fc1bf949d97608530 to your computer and use it in GitHub Desktop.
Save prinsss/8b3632231a999a2fc1bf949d97608530 to your computer and use it in GitHub Desktop.
<?php
namespace App\Providers;
use Illuminate\Support\Str;
use App\Services\PluginManager;
use Illuminate\Support\ServiceProvider;
class PluginServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(PluginManager $plugins)
{
$bootstrappers = $plugins->getEnabledBootstrappers();
foreach ($bootstrappers as $file) {
$bootstrapper = require $file;
// call closure using service container
$this->app->call($bootstrapper);
}
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->singleton('plugins', PluginManager::class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment