You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
883 B

5 months ago
<?php
namespace App\Providers;
use App\Services\Sms\DisabledSmsSender;
use App\Services\Sms\SmsSender;
use App\Services\Sms\TencentCloudSmsSender;
4 months ago
use Illuminate\Support\Facades\URL;
5 months ago
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->bind(SmsSender::class, function ($app) {
return (bool) config('sms.enabled')
? $app->make(TencentCloudSmsSender::class)
: $app->make(DisabledSmsSender::class);
});
5 months ago
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
4 months ago
if (app()->environment('production') || str_starts_with((string) config('app.url'), 'https://')) {
URL::forceScheme('https');
}
5 months ago
}
}