I'm trying to implementing https://github.com/mgp25/Instagram-API
on laravel and after successful login in Instagram i must to use _setUser
to use exiting data after login, for example:
public function check()
{
$username = 'XXX';
$password = 'XXX';
$ig = new Instagram();
try {
$ig->_setUser($username, $password);
} catch (\Exception $e) {
echo 'Something went wrong: '.$e->getMessage()."\n";
exit(0);
}
}
in this code i get this error:
"Call to protected method InstagramAPI\Instagram::_setUser() from context 'App\Http\Controllers\InstagramController'"
For login, you can use this snippet:
and for access user id you can do this:
and after you successfully logged in, try this one for accessing current user: