teknolis / app /Providers /AppServiceProvider.php
OpenAI Codex
Fix storage symlink and adapt cron status for Spaces
1501522
Raw
History Blame Contribute Delete
762 Bytes
<?php
namespace App\Providers;
use Illuminate\Http\Request;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
if (! app()->environment('production')) {
return;
}
$request = request();
if (! $request instanceof Request) {
return;
}
$host = (string) $request->getHost();
if ($host !== '' && str_ends_with($host, '.hf.space')) {
URL::forceScheme('https');
}
}
}