marcreichel/igdb-laravel

IGDB API版本4的Laravel包装器(Apicalypse),包括webhook处理

4.3.0 2024-07-01 09:48 UTC

README

这是IGDB API版本4的Laravel包装器(Apicalypse),包括webhook处理

Packagist Version Packagist Downloads Tests Pint PHPStan CodeFactor codecov License

Cover

基本安装

您可以通过composer使用以下命令安装此包:

composer require marcreichel/igdb-laravel

该包将自动注册其服务提供者。

要发布配置文件到config/igdb.php,请运行:

php artisan igdb:publish

这是配置文件的默认内容:

return [
    /*
     * These are the credentials you got from https://dev.twitch.tv/console/apps
     */
    'credentials' => [
        'client_id' => env('TWITCH_CLIENT_ID', ''),
        'client_secret' => env('TWITCH_CLIENT_SECRET', ''),
    ],

    /*
     * This package caches queries automatically (for 1 hour per default).
     * Here you can set how long each query should be cached (in seconds).
     *
     * To turn cache off set this value to 0
     */
    'cache_lifetime' => env('IGDB_CACHE_LIFETIME', 3600),

    /*
     * Path where the webhooks should be handled.
     */
    'webhook_path' => 'igdb-webhook/handle',

    /*
     * The webhook secret.
     *
     * This needs to be a string of your choice in order to use the webhook
     * functionality.
     */
    'webhook_secret' => env('IGDB_WEBHOOK_SECRET', null),
];

文档

您可以在专门的文档网站上找到完整文档

测试

使用以下命令运行测试:

composer test

贡献

欢迎Pull requests :)