Download the PHP package joukhar/laravel-pixabay without Composer
On this page you can find all versions of the php package joukhar/laravel-pixabay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download joukhar/laravel-pixabay
More information about joukhar/laravel-pixabay
Files in joukhar/laravel-pixabay
Package laravel-pixabay
Short Description Laravel package for accessing the Pixabay API effortlessly.
License MIT
Homepage https://github.com/joukhar/laravel-pixabay
Informations about the package laravel-pixabay
Laravel package for accessing the Pixabay API effortlessly.
Overview
LaravelPixabay is a Laravel package that simplifies the process of interacting with the Pixabay API. It provides a way to search and retrieve images and videos from the Pixabay platform with minimal effort. This package includes various customizable options like image/video type, categories, order, page results, and more.
Requirements
- PHP 8.0 or higher
- Laravel 9.x or higher
- Pixabay API key (you can get this from Pixabay's Developer page)
Support us
If you find my packages useful, consider buying me a coffee to support further development.
Installation
You can install the package via composer:
You can publish the config file or add pixabay service to (config/services.php) file:
Configuration file (config/pixabay.php):
Then add your Pixabay API key to the .env file:
Usage
get images
get specific image
get images with specific type ( )
get videos
get videos with specific type ( )
get specific video
Customizing API Requests
You can customize your queries using several configuration methods provided by the LaravelPixabay
class.
Set Current Page
You can specify which page of results to fetch using setCurrentPage()
:
Set Maximum Results Per Page
The number of results per page can be adjusted using setMaxResults()
:
Enable Safe Search
To filter out adult content, use setSafeSearch()
:
Only Editor's Choice
You can request only editor's choice images or videos using setOnlyEditorChoice()
:
Set Category
To fetch resources of a specific category, use setCategory()
:
Set Order
To order results by popularity, latest, or custom order, use setOrder()
:
Set Minimum Dimensions
You can set the minimum width and height for the images/videos to be returned using setDimentions()
:
Example: Fetching Nature Photos
Exception Handling
If there is an issue with the API request (e.g., invalid API key, request failure), the package throws an Exception
with a detailed error message.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- joukhar
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-pixabay with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^9.0||^10.0||^11.0