I am trying to make a request from one Laravel project to another. The issue that I am getting is that the second Laravel is using the first Laravel Database Connection. So it is complaining that a table does not exist.
Here is the code that I am using.
$data = ['test' => 'foobar'];
$client = new \GuzzleHttp\Client();
$url = getenv('API_BASE') . 'stock-list';
$res = $client->request('POST', $url, [
'headers' => [
'X-Public' => getenv('API_PUBLIC'),
'X-Hash' => ApiService::Encrypt(getenv('API_PRIVATE'), json_encode($data)),
],
'json' => $data,
'http_errors' => false,
]);
echo "<pre>" . print_r($res->getBody()->getContents(), true) . "</pre>";
Has anyone ever come across something like this?