123movies-seo/app/Providers/AppServiceProvider.php

42 lines
1,002 B
PHP
Raw Normal View History

2024-08-24 23:08:42 +03:00
<?php
namespace App\Providers;
use App\Services\Data\Contracts\NewsProviderInterface;
use App\Services\Data\News\ImdbNewsProvider;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
// bind news provider
$this->app->bind(
NewsProviderInterface::class,
ImdbNewsProvider::class
);
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
// dd($this->app['request']->headers->get('x-forwarded-host'));
$this->app['request']->server->set('HTTPS', true);
if ($this->app['request']->headers->has('x-forwarded-host')) {
$this->app['url']->forceRootUrl('https://'.$this->app['request']->server->get('HTTP_X_FORWARDED_HOST'));
}
// if (env('APP_ENV') !== 'local') {
// }
}
}