jbernavaprah/cocktaildb-laravel

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (dev-master) of this package.

Laravel and Lumen wrapper package for the theCocktailDB.com API

dev-master 2020-05-20 13:48 UTC

This package is auto-updated.

Last update: 2021-06-20 16:27:16 UTC


README

Laravel PHP Facade/Wrapper for the TheCocktailDB.com APis

Requirements

  • PHP 7.0 or higher
  • Laravel 7.0 or higher

Installation

You can pull in the package via composer:

composer require jbernavaprah/cocktaildb-laravel

The package will automatically register itself.

If you need to change the API Production Key use:

In the .env file:

COCKTAILDB_KEY = KEY

Or publish configuration:

$ php artisan vendor:publish --provider="JBernavaPrah\CocktailDB\CocktailDBServiceProvider"

and set your API key in the file:

/config/cocktaildb.php

Or you can set the key programmatically at run time :

CocktailDB::setApiKey('KEY');

Usage

use JBernavaPrah\CocktailDB\Facades\CocktailDB;

// Return an Ingredients array
$ingredients = CocktailDB::ingredients();

// Get multiple JBernavaPrah\CocktailDB\Resources\Drinks match name Margaritas
$drinks = CocktailDB::searchDrinksByName('Margarita');

// Get multiple JBernavaPrah\CocktailDB\Resources\Drinks match name Margaritas
$drinks = CocktailDB::searchDrinksByIngredient('Vodka');

// see JBernavaPrah\CocktailDB\Facades\CocktailDB to see more functions...

License

The MIT License (MIT). Please see License File for more information.