2022-07-19 17:27:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use App\Services\LogoService;
|
2022-07-29 18:34:27 +02:00
|
|
|
use App\Services\SettingService;
|
|
|
|
use App\Services\GroupService;
|
2022-07-29 19:22:54 +02:00
|
|
|
use App\Services\TwoFAccountService;
|
2022-07-19 17:27:23 +02:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
use Illuminate\Contracts\Support\DeferrableProvider;
|
|
|
|
|
|
|
|
class TwoFAuthServiceProvider extends ServiceProvider implements DeferrableProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2022-07-29 18:34:27 +02:00
|
|
|
$this->app->singleton(SettingService::class, function () {
|
|
|
|
return new SettingService();
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->singleton(GroupService::class, function ($app) {
|
|
|
|
return new GroupService($app->make(SettingService::class));
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->singleton(LogoService::class, function () {
|
2022-07-19 17:27:23 +02:00
|
|
|
return new LogoService();
|
|
|
|
});
|
2022-07-29 16:42:52 +02:00
|
|
|
|
2022-07-29 19:22:54 +02:00
|
|
|
$this->app->singleton(TwoFAccountService::class, function () {
|
|
|
|
return new TwoFAccountService();
|
|
|
|
});
|
2022-07-19 17:27:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the services provided by the provider.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function provides()
|
|
|
|
{
|
2022-07-29 16:42:52 +02:00
|
|
|
return [
|
2022-07-29 19:22:54 +02:00
|
|
|
GroupService::class,
|
2022-07-29 16:42:52 +02:00
|
|
|
LogoService::class,
|
2022-07-29 19:22:54 +02:00
|
|
|
TwoFAccountService::class,
|
2022-07-29 16:42:52 +02:00
|
|
|
];
|
2022-07-19 17:27:23 +02:00
|
|
|
}
|
|
|
|
}
|