A laravel wrapper to use instagram API and to cache posts

v1.0.4 2020-03-04 09:38 UTC

This package is auto-updated.

Last update: 2021-01-04 11:52:22 UTC


Latest Version on Packagist License: MIT StyleCI Build Status Codecov Total Downloads

This package adds an Instagram post model to your Laravel application, for a cool feed or something like this.

The package relies on the vinkla/instagram package, and adds a solution to cache and a model


You can install the package via composer:

composer require retinens/laravel-instagram

Then run the migrations used for caching, as the API is limited to 200 calls/hour.

php artisan migrate


First you need to generate an access token using Pixel Union's access token generator or by creating an Instagram application.

Put this API key in your .env file


You can run the command to update the cache.

php artisan laravel-instagram:refresh

NOTE : you have to run the Laravel Scheduler in background to use this package. This package adds a command which is executed every 10 minutes to update the cache. More info about the Laravel scheduler

To retrieve all posts use the facade : (this is limited to the latests)


You can specify a number of post to get, it will get the most recents ones :


This returns a collection with all the posts stored.

On each post, you can get attributes:

// Full Size Image
// Caption text 
// HTML formatted caption text (use {!! !!} to escape <br> tags)
// Link to the post



The MIT License (MIT). Please see License File for more information.