<?php

namespace App\Providers;

use App\Browser\BrowserJob;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Support\Facades\Vite;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     */
    public function register(): void
    {
        //
    }

    /**
     * Bootstrap any application services.
     */
    public function boot(UrlGenerator $url): void
    {
        Vite::prefetch(concurrency: 3);

        if (str_starts_with(config('app.url'), "https://")) {
            $url->forceScheme('https');
        }
    }
}
