Trigv home

Search docs

Getting started
  • Overview
  • How Trigv works
Help
  • Send test
  • API keys
  • Channels
  • Image attachments
Guides
  • All guides
  • cURL
  • Laravel
  • AI coding agents
  • Cursor
  • Claude Code
  • OpenAI Codex
  • Other agents
SDKs
  • All SDKs
  • JavaScript
  • Python
  • PHP
  • Go
  • Ruby
  • CLI
API reference
  • API overview
  • POST /api/v1/events
  • Errors & rate limits
  • API security
More
  • OpenAPI spec
Open in ChatGPT ↗ Ask questions about this page Open in Claude ↗ Ask questions about this page Open Markdown https://trigv.com/docs-md/learn/laravel.md

Laravel

Send focused Trigv push alerts from a Laravel app when something important happens: a payment succeeds, a webhook fails, a queue backs up, or a scheduled command finishes.

Use this page when you want Laravel-specific setup. For the package API itself, see the PHP SDK reference.

Install the PHP SDK

The Laravel setup uses the official trigv/trigv Composer package.

Code
composer require trigv/trigv

Add your workspace API key to .env:

Code
TRIGV_API_KEY=trgv_your_api_key

Then expose it through config/services.php:

Code
'trigv' => [
	'api_key' => env('TRIGV_API_KEY'),
	'base_url' => env('TRIGV_BASE_URL', 'https://api.trigv.com/api'),
],

Register the SDK client

Bind the SDK client once so jobs, listeners, controllers, and commands can receive it through Laravel’s container.

Code
use Illuminate\Support\ServiceProvider;
use Trigv\Client;

class AppServiceProvider extends ServiceProvider
{
	public function register(): void
	{
		$this->app->singleton(Client::class, function () {
			return new Client([
				'api_key' => config('services.trigv.api_key'),
				'base_url' => config('services.trigv.base_url'),
			]);
		});
	}
}

Send from a queued job

For user-facing requests, dispatch a job and send the Trigv event in the background. That keeps checkout, form submits, and webhook responses fast.

Code
use Trigv\Client;

class NotifyPaymentReceived
{
	public function __construct(
		private readonly Client $trigv,
	) {}

	public function handle(): void
	{
		$this->trigv->sendEvent([
			'channel' => 'payments',
			'title' => 'Payment received',
			'description' => 'Order #1042 was paid successfully',
			'level' => 'success',
			'event_type' => 'payment.success',
			'idempotency_key' => 'payment-1042-success',
		]);
	}
}

Send from a scheduled command

Trigv works well for commands that normally disappear into logs. Send an alert only when the result matters.

Code
use Illuminate\Console\Command;
use Trigv\Client;

class SyncInvoices extends Command
{
	protected $signature = 'invoices:sync';

	public function handle(Client $trigv): int
	{
		// Run your sync work...

		$trigv->sendEvent([
			'channel' => 'ops',
			'title' => 'Invoice sync finished',
			'description' => 'All billing events are up to date',
			'level' => 'success',
			'event_type' => 'invoices.sync.completed',
		]);

		return self::SUCCESS;
	}
}

Good Laravel use cases

  • Queue failures, stuck workers, and scheduled command results
  • Payment, subscription, and billing events
  • Important webhook outcomes from Stripe, Paddle, Creem, GitHub, or internal systems
  • Admin-only operational alerts that do not belong in customer email

When to use raw HTTP instead

Use the SDK when you are already in PHP or Laravel. Use the event API or cURL guide when you want no Composer dependency, a quick terminal test, or a custom runtime.

PHP SDK reference → · API reference →

Previous cURL Next AI coding agents

On this page

    Native push alerts for developers. Send alerts from webhooks, cron jobs, and scripts. We deliver alerts to your devices, but don't keep the message or notification history on our servers.

    Follow @trigvapp →

    Built by Harish Chouhan

    Product

    • Features
    • How it works
    • Pricing
    • Docs
    • Integrations
    • SDKs
    • API
    • Full LLMs text

    Company

    • About
    • Support
    • Changelog

    Legal

    • Terms & Conditions
    • Privacy Policy
    • Cookie Policy
    • API Security
    All systems ok. Get back to coding.

    © 2026 Webtions OU (dba Trigv)