PHP code example of mayoz / instagram

1. Go to this page and download the library: Download mayoz/instagram 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/ */

    

mayoz / instagram example snippets


    'providers' => [
        // Other service providers...

        Mayoz\Instagram\InstagramServiceProvider::class,
    ],

    'Instagram' => Mayoz\Instagram\Facades\Instagram::class,

    'instagram' => [
        'client_id'     => env('INSTAGRAM_KEY'),
        'client_secret' => env('INSTAGRAM_SECRET'),
        'redirect'      => env('INSTAGRAM_REDIRECT_URI'),
    ],



    namespace App\Http\Controllers;

    use Instagram;
    use Illuminate\Routing\Controller;

    class HomeController extends Controller
    {
        /**
         * Get the most popular Instagram medias.
         *
         * @return Response
         */
        public function getPopularMedia()
        {
            return (array) Instagram::getPopularMedia();
        }
    }