larva / laravel-pexels
This is a Laravel expansion for the pexels.
1.0.1
2023-11-09 06:36 UTC
Requires
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- illuminate/bus: ^8.0 || ^9.0|| ^10.0
- illuminate/http: ^8.0 || ^9.0|| ^10.0
- illuminate/queue: ^8.0 || ^9.0|| ^10.0
- illuminate/support: ^8.0 || ^9.0|| ^10.0
- larva/support: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-12-09 09:01:51 UTC
README
This is a baidu cloud expansion for the laravel
环境需求
- PHP >= 7.2
Installation
composer require larva/laravel-pexels -vv
config
添加设置到 services.php
'pexels'=>[ 'api_key'=>'abcd' ]
Use
try { $results = \Larva\Pexels\Pexels::image()->search('abcd'); print_r($results); } catch (\Exception $e) { print_r($e->getMessage()); } try { $results = \Larva\Pexels\Pexels::video()->search('abcd'); print_r($results); } catch (\Exception $e) { print_r($e->getMessage()); } try { $results = \Larva\Pexels\Pexels::get('/v1/abcd'); print_r($results); } catch (\Exception $e) { print_r($e->getMessage()); }