PHP code example of nexxai / laravel-gallery

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

    

nexxai / laravel-gallery example snippets


return [
    'binary_path' => base_path('tools/gallery-dl' . (PHP_OS_FAMILY === 'Windows' ? '.exe' : '.bin')),
    'binary_download_url' => env(
        'GALLERY_DL_BINARY_DOWNLOAD_URL',
        PHP_OS_FAMILY === 'Windows'
            ? 'https://github.com/mikf/gallery-dl/releases/latest/download/gallery-dl.exe'
            : 'https://github.com/mikf/gallery-dl/releases/latest/download/gallery-dl.bin'
    ),
    'timeout' => 300,
];

use Nexxai\LaravelGallery\GalleryDlClient;

$gallery = app(GalleryDlClient::class);

// Basic binary check
$available = $gallery->isAvailable();

// Resolve profile entries as decoded JSON
$items = $gallery->resolve('https://www.instagram.com/some-profile/', dateAfter: now()->subDay());

// Pass a cookies file for this run
$items = $gallery->resolve(
    'https://www.instagram.com/some-profile/',
    dateAfter: now()->subDay(),
    cookiesPath: '/absolute/path/to/cookies.txt',
);