justraviga / laravel-pexels
Pexels API client for Laravel
Installs: 8 760
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 4
Open Issues: 0
Requires
- php: ^7.4|^8.0
- guzzlehttp/guzzle: ^6.2.1|^7.0
- illuminate/support: ^7.0|^8.0|^9.0
Requires (Dev)
- mockery/mockery: ^1.0
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
Provides access to Pexels API for Laravel projects
Table of contents
Installation
To get the latest version of Laravel Pexels
, simply require the project using Composer:
$ composer require justraviga/laravel-pexels
Or manually update require
block of composer.json
and run composer update
.
{ "require": { "justraviga/laravel-pexels": "^0.1" } }
Using
use JustRaviga\Pexels\Clients\PhotoApiClient; use JustRaviga\Pexels\Facades\Pexels; $client = new PhotoApiClient(); // Good for controller method/artisan command handle()/job handle() dependency injection // OR $client = Pexels::photos(); $response = $client->search('cats'); foreach ($response->photos as $photo){ $photo->width; $photo->height; $photo->url; $photo->src->medium; }