Coder Social home page Coder Social logo

pixabey's Introduction

zartosht/pixabey

Custom PHP Pixabey library for the Laravel 5.* framework - developed by Zartosht.

The package provides an easy interface for sending interacting with Pixabey REST API requests from your Laravel web application.

Note before posting an issue: When posting an issue for the package, always be sure to provide as much information regarding the request as possible. This includes the example cURL request you are trying to transfer into the package syntax, your actual package syntax (the full request) and (if possible) an example URL I can use to test the request myself if need be.

Installation

Pull this package in through Composer.

    {
        "require": {
            "zartosht/pixabey": "*"
        }
    }

or run in terminal: composer require zartosht/pixabey

Laravel 5.5+ Integration

Laravel's package discovery will take care of integration for you.

Laravel 5.* Integration

Add the service provider to your config/app.php file:

    'providers'     => [

        //...
        Zartosht\Pixabey\PixabeyServiceProvider::class,

    ],

Add the facade to your config/app.php file:

    'aliases'       => [

        //...
        'Pixabey'          => Zartosht\Pixabey\Facades\Pixabey::class,

    ],

Laravel 4.* Integration

Add the service provider to your app/config/app.php file:

    'providers'     => [

        //...
        'Zartosht\Pixabey\PixabeyServiceProvider',

    ],

Add the facade to your app/config/app.php file:

    'facades'       => [

        //...
        'Pixabey'          => 'Zartosht\Pixabey\Facades\Pixabey',

    ],

Lumen 5.* integration

In your bootstrap/app.php, make sure you've un-commented the following line (around line 26):

$app->withFacades();

Then, register your class alias:

class_alias('Zartosht\Pixabey\Facades\Pixabey', 'Pixabey');

Finally, you have to register your ServiceProvider (around line 70-80):

/*
|--------------------------------------------------------------------------
| Register Service Providers
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/

// $app->register('App\Providers\AppServiceProvider');

// Package service providers
$app->register(Zartosht\Pixabey\PixabeyServiceProvider::class);

Usage

The package provides an easy interface for interactine with Pixabey REST API for getting images, videos, etc. first you have to sign up in their website, for doing so, click here, and form bottom of this page you can provide a description for your app and usually they will contact you within 24 hours.

Sending GET requests

In order to send a GET request, you need to use the get() method that is provided by the package:

    use Ixudra\Curl\Facades\Curl;

    // Get Fashion Images that are safe
    \Zartosht\Pixabey\Facades\Pixabey::Search()->Fashions()->SafeSearch()->get()

    // Get Animal images page 2 by 100 per page pagination
    \Zartosht\Pixabey\Facades\Pixabey::Search()->Animals()->PerPage(100)->get()

Using Pixabey options

Contact

For any other questions, feel free to use the credentials listed below:

Zartosht Sepideman (developer)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.