<?php

namespace App\Providers;

use App\Contracts\EInvoicing\EInvoiceProviderInterface;
use App\Services\EInvoicing\NullEInvoiceProvider;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;

final class AppServiceProvider extends ServiceProvider
{
    public function register(): void
    {
        $this->app->bind(EInvoiceProviderInterface::class, NullEInvoiceProvider::class);
    }

    public function boot(): void
    {
        Model::preventSilentlyDiscardingAttributes(! $this->app->isProduction());

        if ($this->app->isProduction()) {
            URL::forceScheme('https');
        }
    }
}
