PHPackages                             tristanward/tinygram - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. tristanward/tinygram

ActiveLibrary[Image &amp; Media](/categories/media)

tristanward/tinygram
====================

A light-weight Instagram integration. Pull recent Instagram images into a Laravel website.

1.1.3(6y ago)1431MITPHP

Since Oct 31Pushed 6y agoCompare

[ Source](https://github.com/tristanward/tinygram)[ Packagist](https://packagist.org/packages/tristanward/tinygram)[ RSS](/packages/tristanward-tinygram/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Tinygram
========

[](#tinygram)

A light-weight Instagram integration. Pull recent Instagram images into a Laravel website.

Installation
------------

[](#installation)

Install via composer:

```
$ composer require tristanward/tinygram

```

Configuration
-------------

[](#configuration)

Tinygram requires an Instagram access token to access recent Instagram posts. Refer to the Instagram docs for help generating an access token.

The Instagram access token should be specified in the Laravel `.env` file:

```
INSTAGRAM_ACCESS_TOKEN=

```

Cache Instagram Posts
---------------------

[](#cache-instagram-posts)

Instagram posts can be cached to limit calls to the Instagram API. To do this a `tinyimages` table must first be created:

```
php artisan migrate

```

To cache all recent Instagram posts use the `tinygram:cache` console command:

```
php artistan tinygram:cache

```

This command can be used in Laravel's default scheduler, for example to cache recent Instagram posts at 03:00 on Sundays:

```
// App/Console/Kernel.php

use Tristanward\Tinygram\Console\TinygramCache;

protected $commands = [
    ...
    TinygramCache::class,
];

protected function schedule(Schedule $schedule)
{
    ...
    $schedule->command('tinygram:cache')
        ->sundays()
        ->at('03:00');
}
```

Usage
-----

[](#usage)

Tinygram uses a Laravel facade:

```
