Are you sure your localhost works with https?
Nov 23, 2021
6
Level 4
How to pass the id in API call
I tried this but happen nothing
function coin($id)
{
$host = config('api_host');
$key = config('api_key');
$collection = Http::withHeaders([
'x-api-host' => $host,
'x-api-key' => $key
])->get('https://localhost/game/', [
'id' => $id,
]);
return view('coin', ['collection'=>$collection['data']]);
}
API host is here to get the specific game detail by its ID. Like https://localhost/game/1
How to send id (1 or 2 or 3 or 4...) in the API url...
Please or to participate in this conversation.