PHP code example of tristanward / tinygram

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

    

tristanward / tinygram example snippets


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



use Tristanward\Tinygram\Facades\Tinygram;

// Get 9 most recent Cached Instagram posts
$cached = Tinygram::cachedMedia($count = 9);

// Get 9 most recent Instagram posts live from the Instagram API
$recent = Tinygram::recentMedia($count = 9);

// Get full raw data live from the Instagram API
$raw = Tinygram::recentMediaRaw($count = 9);

$tinyimage->media_id
$tinyimage->link
$tinyimage->location
$tinyimage->standard_url
$tinyimage->thumb_url
$tinyimage->media_created_at

php artisan migrate

php artistan tinygram:cache