定制 joaquinpereira/laravel-pexels 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joaquinpereira/laravel-pexels

Composer 安装命令:

composer require joaquinpereira/laravel-pexels

包简介

library to consume the pexels api (https://www.pexels.com/)

README 文档

README

This is a package made for laravel, that connects to the pexels api and gets images or videos.

Requirements

Installation

composer require joaquinpereira/laravel-pexels

Configuration

You must publish the config/pexel.php configuration file with the following command:

php artisan vendor:publish --provider="joaquinpereira\Pexels\Providers\PexelsServiceProvider" --tag="config"

In the .env file of the project you must add the following key PEXELS_API_KEY and place the value of your key provided by the pexels site

PEXELS_API_KEY="YOUR_PEXELS_API_KEY"

Examples of use:

use joaquinpereira\Pexels\Facades\Pexels;

Route::get('/pexels', function () {
	
	//Images
    dump(Pexels::image_search('modern apartment'));
    dump(Pexels::image_search('modern apartment',20, 25));
    dump(Pexels::image_curated());
    dump(Pexels::image_curated(3,15));
    dump(Pexels::image_detail(17579690));
    dump(Pexels::getRandomImage('beach','landscape'));

	//videos
    dump(Pexels::video_search('android robot'));
    dump(Pexels::video_search('android robot', 3, 15));
    dump(Pexels::popular_videos());
    dump(Pexels::popular_videos(5,20));    
    dump(Pexels::getRandomVideo('dogs'));
    dump(Pexels::video_detail(15570408));
});

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-07-17