PHPackages                             konekt/opsgenie-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. konekt/opsgenie-laravel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

konekt/opsgenie-laravel
=======================

OpsGenie Notifications Channel for Laravel

1.4.0(1y ago)349.9k↑22.3%2MITPHPPHP ^8.0CI passing

Since Jul 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/artkonekt/opsgenie-laravel)[ Packagist](https://packagist.org/packages/konekt/opsgenie-laravel)[ RSS](/packages/konekt-opsgenie-laravel/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (8)Used By (0)

OpsGenie Notifications Channel for Laravel
==========================================

[](#opsgenie-notifications-channel-for-laravel)

[![Tests](https://camo.githubusercontent.com/1fe5cbe48e590d30e265ca3fe1faaa58da729983e8ca95de0d1677609a5a5530/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6172746b6f6e656b742f6f707367656e69652d6c61726176656c2f74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://github.com/artkonekt/opsgenie-laravel/actions?query=workflow%3Atests)[![Packagist Stable Version](https://camo.githubusercontent.com/862190d01b5a8ada8a06410ede8dffdb9a453c31122b3b390bbb09d84c3cab16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b6f6e656b742f6f707367656e69652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265266c6162656c3d737461626c65)](https://packagist.org/packages/konekt/opsgenie-laravel)[![Packagist downloads](https://camo.githubusercontent.com/a2ec703fcebf168c9e7885ad3809ecf1bb2600ed37c378b56e3f1076953b0396/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b6f6e656b742f6f707367656e69652d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/konekt/opsgenie-laravel)[![StyleCI](https://camo.githubusercontent.com/2628f635995186d7ba46abe4377c0bd7ef3d9d087d5e444366c0d690c7650f26/68747470733a2f2f7374796c6563692e696f2f7265706f732f3338393933393837332f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/389939873)[![MIT Software License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package enables Laravel 9 - 12 Applications to send notification to OpsGenie.

Installation
------------

[](#installation)

```
composer require konekt/opsgenie-laravel
```

### Configuration

[](#configuration)

Add your Auth Token, and endpoint config to your application's `config/services.php`:

```
// config/services.php
...

'opsgenie' => [
    'auth_token' => env('OPSGENIE_AUTH_TOKEN'),
    'europe' => true, // OPTIONAL: if true, then the EU API endpoint will be used
    // 'endpoint' => 'https://some.custom.endpoint/', // VERY OPTIONAL: in case you use a non-official endpoint
],
...
```

#### A Note on The OpsGenie API Key

[](#a-note-on-the-opsgenie-api-key)

To create an alert, you need an API key from an **API Integration ✔** and **NOT a "normal" API key ❌**.

❌ Normal API keys can be found at Settings -&gt; API key management:

[![normal_api_key.png](doc/normal_api_key.png)](doc/normal_api_key.png)

✔ Integration API keys can be found ad Teams -&gt; {TEAM} -&gt; Integrations:

[![integration_api_key.png](doc/integration_api_key.png)](doc/integration_api_key.png)

> See more details at [this Atlassian Forum Thread](https://community.atlassian.com/t5/Opsgenie-questions/API-authentication-for-create-alerts/qaq-p/1477556#M773)

Usage
-----

[](#usage)

At the moment of writing there are only 2 OpsGenie commands implemented:

- [Create an Alert](https://docs.opsgenie.com/docs/alert-api#create-alert)
- [Ping a Heartbeat](https://docs.opsgenie.com/docs/heartbeat-api#ping-heartbeat-request)

### Standalone Mode

[](#standalone-mode)

To send a command to OpsGenie without using the Laravel Notifications subsystem, you need to obtain the client, create a command and execute it.

#### Creating an Alert

[](#creating-an-alert)

```
use Konekt\OpsGenie\Client\OpsGenieClient;
use Konekt\OpsGenie\Commands\CreateAlert;

$genie = app(OpsGenieClient::class);
$genie->execute(CreateAlert::withMessage('I am an alert message'));
```

#### Pinging a Heartbeat

[](#pinging-a-heartbeat)

```
use Konekt\OpsGenie\Client\OpsGenieClient;
use Konekt\OpsGenie\Commands\PingHeartbeat;

$genie = app(OpsGenieClient::class);
$genie->execute(new PingHeartbeat('name of the heartbeat'));
```

### Laravel Notifications

[](#laravel-notifications)

You can use the OpsGenie channel in your `via()` method inside a Notification class. The following example creates an alert with the given message at OpsGenie:

```
use Illuminate\Notifications\Notification;
use Konekt\OpsGenie\Commands\CreateAlert;
use Konekt\OpsGenie\Contracts\OpsGenieCommand;
use Konekt\OpsGenie\Contracts\OpsGenieNotification;
use Konekt\OpsGenie\Notification\OpsGenieChannel;

class SiteProblem extends Notification implements OpsGenieNotification
{
    private string $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function via($notifiable)
    {
        return [OpsGenieChannel::class];
    }

    public function toOpsGenie($notifiable): OpsGenieCommand
    {
        return CreateAlert::withMessage($this->message);
    }
}
```

To trigger the sending of the notification, use:

```
Notification::send(['*'], new SiteProblem('Hey, there is a problem here'));
```

Apart from triggering an alert, the Laravel Notification you create can send any OpsGenie command, eg. pinging a hearbeat:

```
use Illuminate\Notifications\Notification;
use Konekt\OpsGenie\Commands\PingHeartbeat;
use Konekt\OpsGenie\Contracts\OpsGenieCommand;
use Konekt\OpsGenie\Contracts\OpsGenieNotification;
use Konekt\OpsGenie\Notification\OpsGenieChannel;

class ERPSyncCompleted extends Notification implements OpsGenieNotification
{
    private string $heartbeat;

    public function __construct(string $heartbeat)
    {
        $this->heartbeat = $heartbeat;
    }

    public function via($notifiable)
    {
        return [OpsGenieChannel::class];
    }

    public function toOpsGenie($notifiable): OpsGenieCommand
    {
        return new PingHeartbeat($this->heartbeat);
    }
}
```

To send this notification use:

```
Notification::send(['*'], new ERPSyncCompleted('erp-sync-heartbeat'));
```

#### Customizing Alerts

[](#customizing-alerts)

It is possible to set further attributes of the created alerts like [setting priority](https://support.atlassian.com/opsgenie/docs/what-is-the-priority-level-of-integration/)or adding description, etc.

This can be done when instantiating the `CreateAlert` command for example in the `toOpsGenie` method:

```
class CriticalConditionDetected extends Notification implements OpsGenieNotification
{
    private string $message;

    public function __construct(string $message)
    {
        $this->message = $message;
    }

    public function via($notifiable)
    {
        return [OpsGenieChannel::class];
    }

    public function toOpsGenie($notifiable): OpsGenieCommand
    {
        $alert = new Alert('Shit hit the fan', ['priority' => 'P1']);

        return new CreateAlert($alert);
    }
}
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance45

Moderate activity, may be stable

Popularity34

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~220 days

Recently: every ~330 days

Total

7

Last Release

434d ago

PHP version history (2 changes)1.0.0PHP ^7.4|^8.0

1.2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c398dd02c93ecf6aa344f367f5744aeb32b4c7bbc23b1b22e95336f45bf0d5a?d=identicon)[konekt](/maintainers/konekt)

---

Top Contributors

[![fulopattila122](https://avatars.githubusercontent.com/u/1162360?v=4)](https://github.com/fulopattila122 "fulopattila122 (29 commits)")[![jdjfisher](https://avatars.githubusercontent.com/u/43887886?v=4)](https://github.com/jdjfisher "jdjfisher (1 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

---

Tags

laravelnotificationskonektartkonektalertingnotification-channelopsgenie

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/konekt-opsgenie-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/konekt-opsgenie-laravel/health.svg)](https://phpackages.com/packages/konekt-opsgenie-laravel)
```

###  Alternatives

[laravel/slack-notification-channel

Slack Notification Channel for laravel.

89169.7M111](/packages/laravel-slack-notification-channel)[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[tzsk/sms

A robust and unified SMS gateway integration package for Laravel, supporting multiple providers.

320244.3k6](/packages/tzsk-sms)[laravel-notification-channels/rocket-chat

Rocket.Chat Notifications channel for Laravel 5.6+

1345.5k](/packages/laravel-notification-channels-rocket-chat)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
