PHP code example of irazasyed / php-stock-media

1. Go to this page and download the library: Download irazasyed/php-stock-media 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/ */

    

irazasyed / php-stock-media example snippets


use Irazasyed\StockMedia;
use Irazasyed\StockMedia\Services\Unsplash;

$apiKey = 'UNSPLASH_API_KEY';

$stockMedia = new StockMedia();
$stockMedia->setDefault(Unsplash::class);

$service = $stockMedia->setApiKey($apiKey);
$result = $service->search(['query' => 'nature']);
bash
composer 
bash
php artisan vendor:publish --tag="php-stock-media-config"