justraviga/laravel-pexels
Laravel Pexels
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;
}
Related Packages
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.1.8 | ^7.4| | ^7.0| | MIT | |
| 0.1.7 | ^7.4| | ^7.0| | MIT | |
| 0.1.6 | ^7.4| | ^7.0| | MIT | |
| 0.1.5 | ^7.4| | ^7.0| | MIT | |
| 0.1.4 | ^7.4| | ^7.0| | MIT | |
| 0.1.3 | ^7.4| | ^7.0| | MIT | |
| 0.1.2 | ^7.4| | ^7.0| | MIT | |
| 0.1.1 | ^7.4| | ^7.0| | MIT | |
| 0.1 | ^7.4| | ^7.0| | MIT |