This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Overview

This package is currently under construction.

Laravel Pokemontcg

Latest Version on Packagist Total Downloads run-tests CodeFactor codecov

This package is a simple API laravel wrapper for Pokemontcg with a sleek Model design for API routes and authentication.

Installation

You can install the package via composer:

composer require slatyo/laravel-pokemontcg

The package will automatically register its service provider.

To publish the config file to config/pokemontcg.php run:

php artisan vendor:publish --provider="Slatyo\LaravelPokemontcg\LaravelPokemontcgServiceProvider"

Default content of config/pokemontcg.php:



/*
 * Default configuration to run the pokemontcg.io API
 */
return [
    'url' => env('POKEMONTCG_API_URL', 'https://api.pokemontcg.io/v2'),
    'secret' => env('POKEMONTCG_SECRET'),
];

Usage

Pokemontcg

Slatyo\LaravelPokemontcg\Pokemontcg is the default wrapper to access everything the Pokemontcg API has to offer.

Supported Models

Cards

To access the cards model you have to call:

$cards = Pokemontcg::cards();
Find by id

Find a specific card by its id:

$cards->find('Test-111');
Search by hp ($from, $to)

Find Pokémon's based on HP:

hp($from, $to); ">
$from = "1";
$to   = "100";
$cards->hp($from, $to);
Search by name

Find Pokémon's based on their name:

$cards->name('Charizard');
Search Pokémon by Pokédex entries ($from, $to)

Find Pokémon's based on their name:

pokedex($from, $to); ">
$from = "1";
$to   = "151";
$cards->pokedex($from, $to);
Search by supertypes

Find Pokémon's by supertypes and types:

$cards->supertype('mega');
$cards->supertype('mega', 'water');
Search query

Search Pokémon's based on a query string - for more details on how the query works check out: Pokemontcg search cards.

$cards->search('name:Char*zard supertype:mega -type:fire');

Sets

To access the sets model you have to call:

$sets = Pokemontcg::sets();
Find by id

Find a specific set by its id:

$sets->find('set-name')
Search query

Search Pokémon sets based on a query string - for more details on how the query works check out: Pokemontcg search sets.

$sets->search('legalities.standard:legal');

Supertypes

To access the supertypes model you have to call:

$supertypes = Pokemontcg::supertypes();
Get all

Return all supertypes:

$supertypes->all()

Subtypes

To access the subtypes model you have to call:

$subtypes = Pokemontcg::subtypes();
Get all

Return all subtypes:

$subtypes->all()

Types

To access the subtypes model you have to call:

$types = Pokemontcg::types();
Get all

Return all types:

$types->all()

Rarities

To access the rarities model you have to call:

$rarities = Pokemontcg::rarities();
Get all

Return all rarities:

$rarities->all()

Testing

Executing the testbench:

composer test

Running PHPStan

composer stan

Running PHPStan on windows

composer stan-2g

Generate coverage reports

composer test:coverage
composer test:coverage-html

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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

You might also like...
A Gitlab API wrapper that helps to automate common actions on CI jobs

Gitlab CI client This is a Gitlab API wrapper that helps to automate common actions on CI jobs (eg: Open a merge request, Open or close an issue etc)

The Official Vultr API PHP Wrapper

WIP - This is not the final API Client. Unstable release use with caution. Vultr API PHP Client. Getting Started Must have a PSR7, PSR17, and PSR18 Co

laravel wrapper for dicom images services

laravel wrapper for dicom images services

Laravel wrapper for the Facebook Graph PHP 8 SDK

Laravel Facebook Graph SDK Installation Getting started with Laravel Facebook Graph is easy - first, install the package via composer composer require

Get the twitter user authentication keys
Get the twitter user authentication keys

TwitterLogin Get the twitter user authentication keys Step 1: Go to Twitter Developer Portal and Apply to create app. Step 2: Go to app setting and en

Gateway-pay-bot - Telegram robot for donating or paying + authentication

gateway-pay-bot این ربات جهت دونیت شدن یا پرداخت های شخصی نوشته شده است دارای قابلیت احراز هویت است درگاه های متصل به ربات : زرین پال نکست پی ایدی پی

AsyncAws Core - shared classes between all AWS services. It also contains the STS client to handle authentication.

AsyncAws Core The repository contains shared classes between all AWS services. It also contains the STS client to handle authentication. Install compo

A simple API documentation package for Laravel using OpenAPI and Redoc

Laravel Redoc Easily publish your API documentation using your OpenAPI document in your Laravel Application. Installation You can install this package

A PHP Stream wrapper for Amazon S3

S3StreamWrapper A simple stream wrapper for Amazon S3. Example ?php use S3StreamWrapper\S3StreamWrapper; S3StreamWrapper::register(); $options = a

Comments
  • Introduce facades

    Introduce facades

    This PR:

    • Introduces facades for the models
    • Introduces alias methods (where...) for Card methods (like whereHp(...) for hp(...))
    • Deletes build/report.junit.xml from git (as it is ignored by .gitignore)
    opened by marcreichel 1
  • Code improvements

    Code improvements

    This PR:

    • Fixes tests by introducing Http faking
    • Improves model endpoint maintainability by automatically generating the underlaying endpoint (by default)
    opened by marcreichel 0
Releases(1.1.0)
Owner
Daniel Henze
Hey, my name is Daniel and i'm a web-developer.
Daniel Henze
Simple Curl based wrapper for Binance API for PHP scripts

Simple Curl based wrapper for Binance API for PHP scripts Feaures API support for SPOT data/trading FAPI/DAPI support for futures data/trading Curl-on

Mr Crypster 22 May 1, 2022
Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP

MailChimp API Super-simple, minimum abstraction MailChimp API v3 wrapper, in PHP. I hate complex wrappers. This lets you get from the MailChimp API do

Drew McLellan 2k Dec 22, 2022
A Laravel wrapper for thephpleague's Fractal package

laravel-api-response A Laravel wrapper for thephpleague's Fractal package Install Via Composer composer require lykegenes/laravel-api-response Then, a

Patrick Samson 3 Mar 15, 2021
The Universal Device Detection library will parse any User Agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model.

DeviceDetector Code Status Description The Universal Device Detection library that parses User Agents and detects devices (desktop, tablet, mobile, tv

Matomo Analytics 2.4k Jan 9, 2023
Twitch Helix API PHP Wrapper for Laravel

Laravel Twitch PHP Twitch Helix API Wrapper for Laravel 5+ ⚠️ Changes on May 01, 2020 Since May 01, 2020, Twitch requires all requests to contain a va

Roman Zipp 87 Dec 7, 2022
A PHP wrapper for Spotify's Web API.

Spotify Web API PHP This is a PHP wrapper for Spotify's Web API. It includes the following: Helper methods for all API endpoints: Information about ar

Jonathan Wilsson 796 Jan 8, 2023
Google Drive Api Wrapper by PHP

GoogleDrive Api Wrapper usage at first you need to create oauth client on google cloud platform. so go to the your google console dashboard and create

Arash Abedi 2 Mar 24, 2022
An elegant wrapper around Google Vision API

STILL UNDER DEVELOPMENT - DO NOT USE IN PRODUCTION Requires PHP 8.0+ For feedback, please contact me. This package provides an elegant wrapper around

Ahmad Mayahi 24 Nov 20, 2022
Google Translator Api Wrapper For Php Developers.

Google Translator Api Wrapper For Php Developers.

Roldex Stark 2 Oct 12, 2022
An unofficial wrapper client for lknpd.nalog.ru API

Unofficial MoyNalog API client An unofficial wrapper client for lknpd.nalog.ru API Install Via Composer $ composer require shoman4eg/moy-nalog Usage S

Artem Dubinin 18 Dec 14, 2022