πAuthentication
Available Authentication Methods
Looking for OAuth2 authentication?
Authenticating all requests
<?php
class ForgeConnector extends Connector
{
public function resolveBaseUrl(): string
{
return 'https://forge.laravel.com/api/v1';
}
/**
* Constructor
*
* @param string $apiKey
*/
public function __construct(protected string $apiKey)
{
$this->withTokenAuth($this->apiKey);
}
}<?php
$forge = new ForgeConnector('my-api-key');
// All API requests will be authenticated with the API keyDefault authentication
Authenticator Classes
Method
Class
Authentication on the fly
Custom Authenticators
Authenticating APIs that require per-request authentication
Last updated