larva/laravel-pexels

This is a Laravel expansion for the pexels.

1.0.1 2023-11-09 06:36 UTC

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 Composer License Latest Stable Version Total Downloads

环境需求

  • 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());
}