I'm replacing old legacy system (Joomla) with Laravel.
At the beginning we have some pages in old and some in new framework so I planned to allow user to login with Laravel authentication method and then forward the credentials to Joomla, so user would be logged in to both at once.
Currently I'm stuck with forwarding part, as I can't figure out how to send login POST variables to Joomla URL.
[code]
$url = 'www.test.dev/index.php/lv/login?task=user.login';
$fields = [
'username' => $credentials['username'],
'password' => $credentials['password']
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query($fields));
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
[/code]