You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tivi_kemana_saja_laravel/app/Providers/AppServiceProvider.php

33 lines
731 B
PHP

<?php
namespace App\Providers;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void {
Http::macro('indokargo', function() {
$headers = [
'oauth' => env('INDOKARGO_API_OAUTH', ''),
'session' => env('INDOKARGO_API_SESSION_ID', '')
];
return Http::withHeaders($headers)->timeout(120)
->baseUrl(env('INDOKARGO_API_URL', '').'/v1/');
});
}
}