farzai / twitch
Laravel Twitch
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-03-12 18:06:33 UTC
README
Still in development
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:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Write tests for your changes.
- Run the tests to ensure they pass.
- 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.