Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Unsplash

Laravel Unsplash Laravel Package

marksitko/laravel-unsplash

Laravel Unsplash is a clean wrapper around the Unsplash API for Laravel apps. Search and fetch photos, collections, users, and topics, track downloads, and use a fluent facade with config-driven credentials to add stock imagery to any project in minutes.

View on GitHub
Deep Wiki
Context7

Powerful Unsplash package for Laravel

Frequently asked questions about Laravel Unsplash
What are the requirements and supported Laravel and PHP versions for laravel-unsplash?
The package is a Laravel service provider plus facade wrapper around the Unsplash HTTP API and targets modern Laravel releases on PHP 8.x, but the authoritative answer is the require block in its composer.json. Check that constraint against your application runtime before committing, because v3.1.0 will not resolve on a Laravel major the package does not declare. Installation itself is a single composer require marksitko/laravel-unsplash, followed by publishing the config file and setting UNSPLASH_ACCESS_KEY.
How do I get an Unsplash access key and configure laravel-unsplash?
Create a developer account at unsplash.com, register an application, and accept the API terms and attribution guidelines to receive an access key. Store the key in your .env as UNSPLASH_ACCESS_KEY and publish the package config with php artisan vendor:publish so credentials stay out of source control. Keep the key per environment so demo and production applications use separate rate-limit quotas.
How do I search Unsplash photos in a specific language with laravel-unsplash v3.1.0?
Version 3.1.0 adds an optional lang query parameter to photo search, so you can request localized titles and descriptions by passing values such as de, fr, or pt-BR. The addition is opt-in and backward compatible: calls that omit lang keep their previous behaviour and let Unsplash apply its own default. Validate any user-supplied locale against Unsplash documented locale list rather than forwarding arbitrary strings, since unsupported values may silently fall back.
Can laravel-unsplash fetch collections, users, and topics, not just photos?
Yes. The wrapper exposes the Unsplash endpoints for photos, collections, users, and topics through a fluent facade, so you can build a media picker, an author byline, or a topic-driven gallery from the same client. Responses are mapped from Unsplash payloads, which means your code should sit behind an internal interface so the rest of the app does not depend on those response shapes. That adapter boundary also makes it easier to swap providers later.
Will laravel-unsplash hit Unsplash rate limits in production?
Unsplash enforces per-application hourly limits, and the demo and production tiers differ by orders of magnitude, so an unbounded call on every page request will throttle under load. The package is a thin adapter and does not shield you from that quota. Cache responses you can reuse, move bulk fetches into queued jobs, and keep a fallback image path for when the API returns a rate-limit error.
How are Unsplash API errors and rate-limit responses surfaced by laravel-unsplash?
The package is a thin wrapper, so failures surface as exceptions from the underlying HTTP client rather than a documented domain-specific exception hierarchy. Wrap calls in your own try/catch, distinguish rate-limit responses from genuine errors, and log the request context so you can debug quota problems. If your application needs typed errors, map them at the adapter layer you build around the facade.
Does laravel-unsplash handle photo download tracking and Unsplash attribution?
The package exposes the download tracking endpoint, so you can fire the required download event when a user actually uses a photo, and photo responses include the photographer name, profile URL, and photo URL needed for credit. Rendering that attribution and linking back to Unsplash per their guidelines is a product and legal obligation the package cannot enforce for you. Build the credit line into the component that renders the image rather than adding it ad hoc per page.
How do I upgrade laravel-unsplash from v2 to v3?
Treat it as a planned minor project rather than a patch bump: review the v3.0.0 changelog for signature and configuration changes, update call sites, and re-run your contract tests before merging. Consumers already on 3.0.0 have a trivial path to 3.1.0, which only adds the optional lang search parameter and requires no config or call-site edits. Greenfield integrations get the lang option from day one.
How do I test code that uses the Unsplash facade without hitting the real API?
Do not let tests reach Unsplash: mock the HTTP layer with Laravel Http::fake in unit tests, or depend on your own interface around the package and bind a fake implementation in the container. Cover the failure paths too, including rate-limit and malformed-response cases, since those are the behaviours most likely to break in production. Confirm the package own CI coverage across its supported matrix before you assume its response mapping is well tested.
What are the alternatives to laravel-unsplash?
You can call the Unsplash REST API directly with Laravel HTTP client and map only the fields you need, which removes a dependency at the cost of writing and maintaining that mapping. Other community wrappers exist, but they carry the same third-party risks because Unsplash controls availability, quota, and response schema regardless of which client you pick. If you only need a handful of curated images, downloading them once and serving from your own storage may be simpler and faster than a live API integration.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core