41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Contracts\Calendar\CalendarClientInterface;
|
|
use App\Contracts\CardDav\CardDavClientInterface;
|
|
use App\Contracts\PhoneNumberNormalizerInterface;
|
|
use App\Contracts\Sms\SmsProviderInterface;
|
|
use App\Services\Calendar\CalDavCalendarClient;
|
|
use App\Services\CardDav\CardDavClient;
|
|
use App\Services\Phone\LibPhoneNumberNormalizer;
|
|
use App\Services\Sms\OvhSmsProvider;
|
|
use GuzzleHttp\Client;
|
|
use GuzzleHttp\ClientInterface;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use libphonenumber\PhoneNumberUtil;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(PhoneNumberUtil::class, fn (): PhoneNumberUtil => PhoneNumberUtil::getInstance());
|
|
$this->app->bind(PhoneNumberNormalizerInterface::class, LibPhoneNumberNormalizer::class);
|
|
$this->app->singleton(ClientInterface::class, fn (): ClientInterface => new Client);
|
|
$this->app->bind(CardDavClientInterface::class, CardDavClient::class);
|
|
$this->app->bind(CalendarClientInterface::class, CalDavCalendarClient::class);
|
|
$this->app->bind(SmsProviderInterface::class, OvhSmsProvider::class);
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|