mirror of
https://github.com/brufdev/many-notes.git
synced 2026-01-26 21:09:12 -06:00
Add application configurations
This commit is contained in:
@@ -4,7 +4,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Vite;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Override;
|
||||
use SocialiteProviders\Authentik\Provider as AuthentikProvider;
|
||||
@@ -28,6 +32,10 @@ final class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->configureDates();
|
||||
$this->configureModels();
|
||||
$this->configureVite();
|
||||
|
||||
Event::listen(function (SocialiteWasCalled $event): void {
|
||||
$event->extendSocialite('authentik', AuthentikProvider::class);
|
||||
});
|
||||
@@ -38,4 +46,30 @@ final class AppServiceProvider extends ServiceProvider
|
||||
$event->extendSocialite('zitadel', ZitadelProvider::class);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the application's dates.
|
||||
*/
|
||||
private function configureDates(): void
|
||||
{
|
||||
Date::use(CarbonImmutable::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the application's models.
|
||||
*/
|
||||
private function configureModels(): void
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
Model::shouldBeStrict();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the application's Vite instance.
|
||||
*/
|
||||
private function configureVite(): void
|
||||
{
|
||||
Vite::useAggressivePrefetching();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user