Quickly add a bearer token to HTTP request

There’s a withToken method to attach the Authorization header to a request.

// Booo!
Http::withHeader([
'Authorization' => 'Bearer dQw4w9WgXcq'
])
 
// YES!
Http::withToken('dQw4w9WgXcq');

Tip given by @p3ym4n

Recent New Courses