All Projects → shweshi → Laravel-Unsplash-Wrapper

shweshi / Laravel-Unsplash-Wrapper

Licence: MIT license
A Laravel wrapper for Unsplash API's.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Laravel-Unsplash-Wrapper

Nova-Dark-Theme
A dark theme for Laravel Nova
Stars: ✭ 72 (+242.86%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
maintenance-mode
An enhanced maintenance mode for Laravel.
Stars: ✭ 117 (+457.14%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
devtube
Laravel YouTube and Online Video viewing and download interface.
Stars: ✭ 30 (+42.86%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Laravel Settings
Simple Settings package for a laravel application
Stars: ✭ 45 (+114.29%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (+200%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (+442.86%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (+276.19%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+995.24%)
Mutual labels:  laravel-package, laravel-5-package, laravel5
python-unsplash
Python wrapper for the Unsplash API.
Stars: ✭ 130 (+519.05%)
Mutual labels:  unsplash, unsplash-api
voyager-portfolio
A Portfolio Module for Laravel Voyager 💋
Stars: ✭ 15 (-28.57%)
Mutual labels:  laravel-package, laravel-5-package
laravel-ab
Laravel A/B experiment testing tool
Stars: ✭ 108 (+414.29%)
Mutual labels:  laravel-package, laravel-5-package
go-unsplash
Go Client for the Unsplash API
Stars: ✭ 70 (+233.33%)
Mutual labels:  unsplash, unsplash-api
flash
An easy way for Laravel flash notifications.
Stars: ✭ 14 (-33.33%)
Mutual labels:  laravel-package, laravel-5-package
voyager-page-blocks
A module to provide page blocks for Voyager 📝
Stars: ✭ 80 (+280.95%)
Mutual labels:  laravel-package, laravel-5-package
laravel-two-factor-authentication
A two-factor authentication package for Laravel >= 8
Stars: ✭ 37 (+76.19%)
Mutual labels:  laravel-package, laravel-5-package
instant-images
Instantly upload photos from Unsplash, Pixabay and Pexels to your website without leaving WordPress.
Stars: ✭ 26 (+23.81%)
Mutual labels:  unsplash, unsplash-api
laravel-unsplash
Powerful Unsplash package for Laravel
Stars: ✭ 50 (+138.1%)
Mutual labels:  unsplash, laravel-unsplash
laravel-hijri-dates
Hijri dates for Laravel
Stars: ✭ 25 (+19.05%)
Mutual labels:  laravel-5-package, laravel5
sweetalert
Laravel 5 Package for SweetAlert2. Use this package to easily show sweetalert2 prompts in your laravel app.
Stars: ✭ 28 (+33.33%)
Mutual labels:  laravel-package, laravel-5-package
laravel-browsershot
Browsershot wrapper for Laravel 5
Stars: ✭ 108 (+414.29%)
Mutual labels:  laravel-5-package, laravel5

LaravelUnsplashWrapper

Latest Version on Packagist Scrutinizer Code Quality StyleCI Build Status Total Downloads FOSSA Status

A Laravel wrapper for Unsplash.

Install

Via Composer

$ composer require shweshi/laravel-unsplash-wrapper

If you do not run Laravel 5.5 (or higher), then add the service provider in config/app.php:

shweshi\LaravelUnsplashWrapper\Providers\UnsplashServiceProvider::class,
shweshi\LaravelUnsplashWrapper\Providers\UnsplashSearchServiceProvider::class,
shweshi\LaravelUnsplashWrapper\Providers\UnsplashUsersServiceProvider::class,
shweshi\LaravelUnsplashWrapper\Providers\UnsplashPhotosServiceProvider::class,
shweshi\LaravelUnsplashWrapper\Providers\UnsplashCollectionsServiceProvider::class,

If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.

Next under the alias array in config/app.php add

'UnsplashSearch' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashSearchFacade::class,
'UnsplashUsers' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashUsersFacade::class,
'UnsplashPhotos' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashPhotosFacade::class,
'UnsplashCollections' => shweshi\LaravelUnsplashWrapper\Facades\UnsplashCollectionsFacade::class,

You must publish the configuration to provide your own service provider stub.

$ php artisan vendor:publish --provider="shweshi\LaravelUnsplashWrapper\Providers\UnsplashServiceProvider"

Update your settings in the generated app/config/unsplash.php configuration file.

return [
    'ApplicationID' => 'YOUR APPLICATION ACCES KEY HERE',
];

Usage

See documention for params and others at unsplash docs

List of methods:

Photos

$photos        = UnsplashPhotos::photos([]);          // list of all photos
$photo         = UnsplashPhotos::single($id, $params);     // single photo
$statistic     = UnsplashPhotos::statistic($id, $params);  // single photo statistics
$downloadUrl   = UnsplashPhotos::download($id, $params);   // single photo download link
$curatedPhotos = UnsplashPhotos::curated($params);         // list of curated photos
$randomPhoto   = UnsplashPhotos::random($params);          // random photo

Users

use UnsplashUsers;

$user         = UnsplashUsers::profile($username, $params);      // single user
$portfolio    = UnsplashUsers::portfolio($username);             // single user's portfolio
$photos       = UnsplashUsers::photos($username, $params);       // single user's photos
$photos       = UnsplashUsers::likes($username, $params);        // single user's likes
$collections  = UnsplashUsers::collections($username, $params);  // single user's collections
$statistics   = UnsplashUsers::statistics($username, $params);   // single user's statistics

Collections

use UnsplashCollections;

$collection  = UnsplashCollections::collections($params);    // list of all collections
$collection  = UnsplashCollections::single($id, $params);    // single collections
$photos      = UnsplashCollections::photos($id, $params);    // collection photos
$statistic   = UnsplashCollections::statistic($id, $params); // single collections statistics
$collection  = UnsplashCollections::curated($params);        // list of curated collections
$collection  = UnsplashCollections::related($id, $params);   // list of related collections
$collection  = UnsplashCollections::featured($params);       // list of featured collections

Search

use UnsplashSearch;

$photos     = UnsplashSearch::photo($query, $params);
$collection = UnsplashSearch::collection($query, $params);
$user       = UnsplashSearch::user($query, $params);

Example

echo UnsplashPhotos::photos(['page' => 1, 'order_by' => 'oldest']);

will get you something like

ixlib=rb-0.3.5\u0026q=80\u0026fm=jpg\u0026crop=faces\u0026cs=tinysrgb\u0026fit=crop\u0026h=64\u0026w=64\u0026s=4ddd6656ddd74206872f45c033371087","large":"https://images.unsplash.com/profile-1441298310363-3eb4b1feb829?
.....

which you will need to format

Contributing

Please see CONTRIBUTING and CODE OF CONDUCT for details.

License

FOSSA Status

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].