Create ServiceProvider.php
This commit is contained in:
parent
655f8a4bdf
commit
9233d7ea02
1 changed files with 49 additions and 0 deletions
49
src/ServiceProvider.php
Normal file
49
src/ServiceProvider.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace wickedsoft\NetBox;
|
||||
|
||||
class ServiceProvider extends \Illuminate\Support\ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../config/netbox.php' => config_path('netbox.php')
|
||||
], 'config');
|
||||
|
||||
\Auth::provider('netbox', function ($app, array $config) {
|
||||
return new \wickedsoft\NetBox\Providers\HostFactProvider();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provides()
|
||||
{
|
||||
return ['wickedsoft\NetBox\NetBox', 'NetBox'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton('wickedsoft\NetBox\NetBox', function ($app) {
|
||||
$netBox = new NetBox($app);
|
||||
$netBox->panel($netBox->getDefaultPanel());
|
||||
|
||||
return $netBox;
|
||||
});
|
||||
|
||||
$this->app->alias('wickedsoft\NetBox\NetBox', 'NetBox');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue