bjsmasth
$options = [
'grant_type' => 'password',
'client_id' => 'CONSUMERKEY',
'client_secret' => 'CONSUMERSECRET',
'username' => 'SALESFORCE_USERNAME',
'password' => 'SALESFORCE_PASSWORD AND SECURITY_TOKEN'
];
$salesforce = new bjsmasth\Salesforce\Authentication\PasswordAuthentication($options);
$salesforce->authenticate();
$access_token = $salesforce->getAccessToken();
$instance_url = $salesforce->getInstanceUrl();
Change Endpoint
$salesforce = new bjsmasth\Salesforce\Authentication\PasswordAuthentication($options);
$salesforce->setEndpoint('https://test.salesforce.com/');
$salesforce->authenticate();
$access_token = $salesforce->getAccessToken();
$instance_url = $salesforce->getInstanceUrl();