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/ */

    

elevencodes / instagram-laravel example snippets


    'providers' => array(
        // ...
        'Elevencodes\InstagramLaravel\InstagramLaravelServiceProvider',
    )

    'aliases' => array(
        // ...
        'Instagram' 	  => 'Elevencodes\InstagramLaravel\Facades\InstagramLaravel',
    )

	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('/');
	}

Route::get('/users/authorize', array('as' => 'authorize', 'uses' => 'UsersController@getAuthorize'));
Route::get('/login', array('as' => 'login', 'uses' => 'UsersController@getLogin'));
Route::get('/logout', array('as' => 'logout', 'uses' => 'UsersController@getLogout'));

$user = Instagram::getCurrentUser();
json
{
	"vel/framework": "4.1.*",
		"php-instagram-api/php-instagram-api": "dev-master",
        "elevencodes/instagram-laravel": "2.0.*@dev"
	}
}
bash
php artisan config:publish elevencodes/instagram-laravel