2020-12-01 17:02:10 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
2021-02-28 12:04:49 +01:00
|
|
|
use Illuminate\Support\Facades\URL;
|
2020-12-01 17:02:10 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
2021-08-25 09:24:01 +02:00
|
|
|
//! Important pourra etre retiré quand la V1 sera supprimé
|
|
|
|
|
// empeche l'encapsulation dans data
|
2020-12-01 17:02:10 +01:00
|
|
|
JsonResource::withoutWrapping();
|
2021-08-04 09:42:48 +02:00
|
|
|
if (!in_array(config('app.env'), ['local', 'testing'])) {
|
2021-02-28 12:04:49 +01:00
|
|
|
URL::forceScheme('https');
|
2020-12-01 17:02:10 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|