2022-07-19 17:27:23 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2022-11-22 15:15:52 +01:00
|
|
|
use App\Factories\MigratorFactoryInterface;
|
2024-10-01 15:36:18 +02:00
|
|
|
use App\Services\IconService;
|
2024-11-09 10:18:45 +01:00
|
|
|
use App\Services\IconStoreService;
|
2022-07-19 17:27:23 +02:00
|
|
|
use App\Services\LogoService;
|
2022-09-21 21:50:41 +02:00
|
|
|
use App\Services\ReleaseRadarService;
|
2022-11-22 15:15:52 +01:00
|
|
|
use App\Services\SettingService;
|
2022-10-07 18:58:48 +02:00
|
|
|
use App\Services\TwoFAccountService;
|
2024-11-15 10:39:29 +01:00
|
|
|
use enshrined\svgSanitize\Sanitizer;
|
2022-07-19 17:27:23 +02:00
|
|
|
use Illuminate\Contracts\Support\DeferrableProvider;
|
2022-11-22 15:15:52 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2024-07-03 11:16:08 +02:00
|
|
|
use Zxing\QrReader;
|
2022-07-19 17:27:23 +02:00
|
|
|
|
|
|
|
class TwoFAuthServiceProvider extends ServiceProvider implements DeferrableProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
2022-10-07 18:58:48 +02:00
|
|
|
$this->app->singleton(TwoFAccountService::class, function ($app) {
|
|
|
|
return new TwoFAccountService($app->make(MigratorFactoryInterface::class));
|
|
|
|
});
|
|
|
|
|
2022-07-29 18:34:27 +02:00
|
|
|
$this->app->singleton(SettingService::class, function () {
|
2024-09-26 23:50:01 +02:00
|
|
|
return new SettingService;
|
2022-07-29 18:34:27 +02:00
|
|
|
});
|
|
|
|
|
2024-11-15 10:39:29 +01:00
|
|
|
$this->app->singleton(IconStoreService::class, function ($app) {
|
|
|
|
return new IconStoreService($app->make(Sanitizer::class));
|
2024-10-18 14:28:45 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->singleton(LogoService::class, function ($app) {
|
2024-09-26 23:50:01 +02:00
|
|
|
return new LogoService;
|
2022-07-19 17:27:23 +02:00
|
|
|
});
|
2022-09-21 21:50:41 +02:00
|
|
|
|
2024-10-18 14:28:45 +02:00
|
|
|
$this->app->singleton(IconService::class, function ($app) {
|
2024-10-01 15:36:18 +02:00
|
|
|
return new IconService;
|
|
|
|
});
|
|
|
|
|
2022-09-21 21:50:41 +02:00
|
|
|
$this->app->singleton(ReleaseRadarService::class, function () {
|
2024-09-26 23:50:01 +02:00
|
|
|
return new ReleaseRadarService;
|
2022-09-21 21:50:41 +02:00
|
|
|
});
|
2024-07-03 11:16:08 +02:00
|
|
|
|
2024-09-27 11:54:19 +02:00
|
|
|
$this->app->bind(QrReader::class, function ($app, array $parameters) {
|
2024-07-03 11:16:08 +02:00
|
|
|
return new QrReader($parameters['imgSource'], $parameters['sourceType']);
|
|
|
|
});
|
2022-07-19 17:27:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap services.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
2022-11-22 15:15:52 +01:00
|
|
|
}
|
2022-07-19 17:27:23 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the services provided by the provider.
|
|
|
|
*
|
2022-12-09 10:52:17 +01:00
|
|
|
* @codeCoverageIgnore
|
2022-12-13 12:07:29 +01:00
|
|
|
*
|
2022-07-19 17:27:23 +02:00
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function provides()
|
|
|
|
{
|
2022-07-29 16:42:52 +02:00
|
|
|
return [
|
2024-10-01 15:36:18 +02:00
|
|
|
IconService::class,
|
2024-10-18 14:28:45 +02:00
|
|
|
IconStoreService::class,
|
2022-07-29 16:42:52 +02:00
|
|
|
LogoService::class,
|
2024-10-18 14:28:45 +02:00
|
|
|
QrReader::class,
|
2022-10-12 11:10:51 +02:00
|
|
|
ReleaseRadarService::class,
|
2022-07-29 16:42:52 +02:00
|
|
|
];
|
2022-07-19 17:27:23 +02:00
|
|
|
}
|
|
|
|
}
|