PHP code example of elevencodes / instagram-laravel
1. Go to this page and download the library: Download elevencodes/instagram-laravel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
public function getLogin()
{
if (Session::has(Config::get('instagram::session_name')))
Session::forget(Config::get('instagram::session_name'));
Instagram::authorize();
}
public function getAuthorize()
{
Session::put(Config::get('instagram::session_name'), Instagram::getAccessToken(Input::get('code')));
return Redirect::to('/');
}
public function getLogout()
{
Session::forget(Config::get('instagram::session_name'));
return Redirect::to('/');
}