Files
ots/app/Providers/AppServiceProvider.php
T
Twyco 76bd1536bf
CI/CD / test_and_check_app (push) Successful in 3m23s
CI/CD / Publish immutable image (push) Successful in 2m29s
fix
2026-09-11 00:45:24 +02:00

56 lines
1.2 KiB
PHP

<?php
namespace App\Providers;
use Carbon\CarbonImmutable;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
$this->configureDefaults();
if ($this->app->environment() !== 'local') {
URL::forceScheme('https');
}
}
/**
* Configure default behaviors for production-ready applications.
*/
protected function configureDefaults(): void
{
Date::use(CarbonImmutable::class);
DB::prohibitDestructiveCommands(
app()->isProduction(),
);
Password::defaults(fn (): ?Password => app()->isProduction()
? Password::min(12)
->mixedCase()
->letters()
->numbers()
->symbols()
->uncompromised()
: null,
);
}
}