Skip to content
🖼 Get easily any Unsplash images with a clean PHP class. It's a really lightweight class that helps to get easily any images from Unsplash.com while keeping your project clean.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Image
tests/Image
.gitignore
README.md
composer.json Wrong license Aug 28, 2017
phpunit.xml.dist

README.md

Unsplash Helper

Get Unsplash Images Easily

Get easily any Unsplash images with a clean PHP class.

It's a really lightweight and simple PHP class that helps you to get easily any images from Unsplash.com while keeping your project clean.

Example

use PH7\Image\Unsplash;

$unsplash = new Unsplash();
$unsplash->setWidth(600)
    ->setHeight(400)
    ->setQuality(80)
    ->setImageId('photo-1462045504115-6c1d931f07d1');

echo '<img src="' . $unsplash->getImage() . '">';

$unsplash->setImageId('photo-1500045992661-f978470eaf7b');
$unsplash->setFit(Unsplash::MAX_FIT);

echo '<img src="' . $unsplash->getImage() . '">';

Installation

  1. Install Composer (https://getcomposer.org)
  2. Include it in your project:
composer require ph-7/image-unsplash

Requirements

Author

Made with ♥ and care by Pierre-Henry Soria

License

MIT License. Enjoy! 😃

You can’t perform that action at this time.