Following code i implemented for automatic login and set session using CURl. But will not authenticate. Any one explain me for laravel authenticate using CURL.
$url = 'http://localhost/site/login'; (Laravel Login URl)
$username = 'xxx@xxx.com';
$password = 'password';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2VVhe32
via IFTTT
Aucun commentaire:
Enregistrer un commentaire