lasthourcloud/app/Providers/AppServiceProvider.php

35 lines
774 B
PHP
Raw Normal View History

2023-03-17 15:33:48 +01:00
<?php
namespace App\Providers;
2023-05-03 07:24:34 +01:00
use App\Jobs\CoolifyTask;
2023-05-26 12:31:29 +02:00
use App\Models\InstanceSettings;
2023-03-30 09:47:04 +02:00
use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Support\Facades\Queue;
2023-05-26 12:31:29 +02:00
use Illuminate\Support\Facades\URL;
2023-03-17 15:33:48 +01:00
use Illuminate\Support\ServiceProvider;
2023-05-26 12:31:29 +02:00
use Illuminate\Support\Str;
2023-03-17 15:33:48 +01:00
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
2023-05-26 12:34:15 +02:00
if ($this->app->environment('production')) {
$settings = InstanceSettings::first();
if (Str::startsWith($settings->fqdn, 'https')) {
URL::forceScheme('https');
}
2023-05-26 12:31:29 +02:00
}
2023-03-17 15:33:48 +01:00
}
}