Laravel Packages

Integrate Unsplash in Your Laravel Application

Published
Integrate Unsplash in Your Laravel Application image

The Laravel Unsplash package provides an easy way to integrate your Laravel project with the Unsplash API. Use the API to fetch photos, collections, and user data from Unsplash:

use Xchimx\UnsplashApi\Facades\Unsplash;
 
$photos = Unsplash::searchPhotos('Nature');
$randomPhoto = Unsplash::getRandomPhoto('Nature');
$downloadLink = Unsplash::getPhotoDownloadLink($id);
$user = Unsplash::getUser($name);
$userPhotos = Unsplash::getUserPhotos($username, 15, $page);

Package Features

  • Photo search, advanced photo search, and collections search
  • Get photos by ID or get a random photos
  • Get users and user photos
  • Rate limiting middleware
  • And more...

This package is available on GitHub at xchimx/laravel-unsplash. The readme includes installation, configuration details, usage instructions, and controller examples. To get started with the Unsplash API, you will need to register as a developer by visiting the official developer documentation.

You can install this package with Composer:

$ composer require xchimx/laravel-unsplash
 
$ php artisan vendor:publish \
--provider="Xchimx\UnsplashApi\UnsplashServiceProvider" --tag="config"
Paul Redmond photo

Staff writer at Laravel News. Full stack web developer and author.

Sponsored

masteringlaravel logo
Laravel Code Review

Get expert guidance in a few days with a Laravel code review

Visit Laravel Code Review

The latest

View all →
Laravel Image Responses: Serve Resized Images From Routes image

Laravel Image Responses: Serve Resized Images From Routes

Read article
Pause All Laravel Queues During a Deploy image

Pause All Laravel Queues During a Deploy

Read article
Laravel Terminal UI for the artisan dev Command image

Laravel Terminal UI for the artisan dev Command

Read article
Pause All Queues and a New artisan dev UI in Laravel 13.25 image

Pause All Queues and a New artisan dev UI in Laravel 13.25

Read article
Laravel monitoring that doesn't bill you by your traffic image

Laravel monitoring that doesn't bill you by your traffic

Read article
Mock PHP Classes in Tests With the Double Library image

Mock PHP Classes in Tests With the Double Library

Read article