Skip to content

farzai/laravel-twitch

Repository files navigation

Laravel Twitch

Still in development

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status codecov Total Downloads

Description

Laravel Twitch is a package that provides an easy way to interact with the Twitch API using Laravel. It simplifies the process of making requests to the Twitch API and handling the responses. The package includes features such as authentication, making API requests, and handling pagination.

Installation

To install the package, you can use Composer:

composer require farzai/twitch

The package requires PHP 8.1 or higher and the following dependencies:

  • spatie/laravel-package-tools: ^1.14.0
  • illuminate/contracts: ^10.0

Usage

Here are some examples of how to use the package:

Retrieving an Access Token

use Farzai\Twitch\Authorizer;

$accessToken = Authorizer::retrieveAccessToken();

Making API Requests

use Farzai\Twitch\Builder;
use Farzai\Twitch\Models\Game;

$builder = new Builder(Game::class);
$games = $builder->search('Fortnite')->get();

Configuration

To configure the package, you need to set up the necessary credentials in your .env file:

TWITCH_CLIENT_ID=your-client-id
TWITCH_CLIENT_SECRET=your-client-secret

You can also publish the configuration file to customize the package settings:

php artisan vendor:publish --tag=twitch-config

Contributing

If you would like to contribute to the package, please follow these guidelines:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Write tests for your changes.
  4. Run the tests to ensure they pass.
  5. Submit a pull request with a clear description of your changes.

If you find any issues or have any questions, feel free to open an issue on GitHub.

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages