---
title: Sending custom events
description: Send custom events from PHP applications to Honeybadger Insights for monitoring and analysis.
url: https://docs.honeybadger.io/lib/php/insights/sending-events-to-insights/
---

You can send your own application events to [Honeybadger Insights](https://docs.honeybadger.io/guides/insights/) with Honeybadger’s PHP (v2.19+) and Laravel (v4.1+) packages. (For the events the Laravel package captures on its own, see [Automatic instrumentation](https://docs.honeybadger.io/lib/php/insights/automatic-instrumentation/); to forward application logs, see [Capturing logs](https://docs.honeybadger.io/lib/php/insights/capturing-logs/).)

Start by configuring Honeybadger and enabling events:

```php
$honeybadger = Honeybadger\Honeybadger::new([
  'api_key' => 'my-api-key',
  'events' => [
    'enabled' => true
  ]
]);
```

Then you can send events using the `$honeybadger->event` method:

```php
$honeybadger->event('user_activity', [
  'action' => 'registration',
  'user_id' => 123
])
```

The first argument is the type of the event (`event_type`) and the second argument is an object containing any additional data you want to include.

`$honeybadger->event` can also be called with a single argument as an object containing the data for the event:

```php
$honeybadger->event([
  'event_type' => 'user_activity',
  'action' => 'registration',
  'user_id' => 123
])
```

A timestamp field (`ts`) will be automatically added to the event data if it is not provided, regardless of the method used to send the event.

These events may be found using the following BadgerQL query:

```badgerql
fields @ts, @preview
| filter event_type::str == "user_activity"
| filter action::str == "registration"
| sort @ts
```

## Managing event volume

If some events are noisy or you’d like to reduce quota consumption:

* [Filtering events](https://docs.honeybadger.io/lib/php/insights/filtering-events/) — inspect, modify, or drop events with a callback.
* [Sampling events](https://docs.honeybadger.io/lib/php/insights/sampling-events/) — send only a percentage of events.

---

## Try Honeybadger for FREE

Intelligent logging, error tracking, and Just Enough APM™ in one dev-friendly platform. Find and fix problems before users notice.

[Start free trial](https://app.honeybadger.io/users/sign_up)

[See plans and pricing](https://www.honeybadger.io/plans/)
