Created
November 1, 2016 06:42
-
-
Save prinsss/8b3632231a999a2fc1bf949d97608530 to your computer and use it in GitHub Desktop.
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 | |
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