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

tinkerwell logo
Tinkerwell

Enjoy coding and debugging in an editor designed for fast feedback and quick iterations. It's like a shell for your application – but with multi-line editing, code completion, and more.

Visit Tinkerwell

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article