2025-12-12 23:07:04 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Interfaces\MovieDbInterface;
|
|
|
|
|
use App\Services\OmdbService;
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2025-12-14 13:42:50 -06:00
|
|
|
use Livewire\Livewire;
|
2025-12-12 23:07:04 -06:00
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*/
|
|
|
|
|
public function register(): void
|
|
|
|
|
{
|
|
|
|
|
$this->app->bind(MovieDbInterface::class, OmdbService::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*/
|
|
|
|
|
public function boot(): void
|
|
|
|
|
{
|
2025-12-14 12:39:24 -06:00
|
|
|
if ($this->app->environment('production')) {
|
|
|
|
|
\URL::forceScheme('https');
|
|
|
|
|
}
|
2025-12-14 13:42:50 -06:00
|
|
|
|
|
|
|
|
// Configure Livewire CSP nonce
|
|
|
|
|
Livewire::setScriptNonce(function () {
|
|
|
|
|
return request()->attributes->get('csp-nonce');
|
|
|
|
|
});
|
2025-12-12 23:07:04 -06:00
|
|
|
}
|
|
|
|
|
}
|