Created
October 12, 2018 02:27
-
-
Save localdisk/9d4376a6681f232027ccfb89f416e514 to your computer and use it in GitHub Desktop.
DevelopServiceProvider
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 Yaranaio\Providers; | |
use Barryvdh\Debugbar\Facade; | |
use Barryvdh\Debugbar\ServiceProvider as DebugbarServiceProvider; | |
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider; | |
use Illuminate\Foundation\AliasLoader; | |
use Illuminate\Support\ServiceProvider; | |
class DevelopServiceProvider extends ServiceProvider | |
{ | |
/** | |
* @var array | |
*/ | |
protected $providers = [ | |
IdeHelperServiceProvider::class, | |
DebugbarServiceProvider::class, | |
]; | |
/** | |
* @var array | |
*/ | |
protected $facadeAliases = [ | |
Facade::class, | |
]; | |
/** | |
* Bootstrap the application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// | |
} | |
/** | |
* Register the application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
if ($this->app->environment() === 'local') { | |
$this->registerServiceProviders(); | |
$this->registerFacadeAliases(); | |
} | |
} | |
/** | |
* register service providers | |
*/ | |
protected function registerServiceProviders() | |
{ | |
foreach ($this->providers as $provider) { | |
$this->app->register($provider); | |
} | |
} | |
/** | |
* add class aliases | |
*/ | |
protected function registerFacadeAliases() | |
{ | |
$loader = AliasLoader::getInstance(); | |
foreach ($this->facadeAliases as $alias => $facade) { | |
$loader->alias($alias, $facade); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment