PHP code example of kg-bot / laravel-tikfinity-webhooks
1. Go to this page and download the library: Download kg-bot/laravel-tikfinity-webhooks library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kg-bot / laravel-tikfinity-webhooks example snippets
use Closure;
use KgBot\TikFinityWebhooks\Contracts\PipeContract;
use KgBot\TikFinityWebhooks\DTO\WebhookData;
final class VerifyGiftWebhook implements PipeContract
{
/**
* @throws EventNotAllowed
*/
public function handle(WebhookData $webhookData, Closure $next): mixed
{
if(!$webhookData->isGiftEvent()) {
throw new EventNotAllowed('Event is not a gift event');
}
return $next($webhookData);
}
}
return [
'pipes' => [
'gift' => [
VerifyGiftWebhook::class,
// Other pipes can be added here
],
],
];