PHPackages                             danhvo/pagerduty - 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. danhvo/pagerduty

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

danhvo/pagerduty
================

A Laravel notification channel for sending PagerDuty events.

0.4.2(4y ago)01.7k1MITPHPPHP &gt;=7.1

Since May 12Pushed 4y agoCompare

[ Source](https://github.com/danhvogeocomply/pagerduty)[ Packagist](https://packagist.org/packages/danhvo/pagerduty)[ Docs](https://github.com/laravel-notification-channels/pagerduty)[ RSS](/packages/danhvo-pagerduty/feed)WikiDiscussions master Synced 3w ago

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

PagerDuty Event notifications channel for Laravel
=================================================

[](#pagerduty-event-notifications-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/906ea5172c5ddf57bf0d03f2a8cb75e968556dac53fe9e4a2767593bdb829aff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7061676572647574792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/pagerduty)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/217aa963880a9d4b08b4fcdb597bfb32922e09544e49971bac1bbb8f3d2a04a1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7061676572647574792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/pagerduty)[![StyleCI](https://camo.githubusercontent.com/a87acb336401bc485057eb997346a541a54656b2a5843985543871aa9dca9f4e/68747470733a2f2f7374796c6563692e696f2f7265706f732f39303939333430382f736869656c64)](https://styleci.io/repos/90993408)[![SensioLabsInsight](https://camo.githubusercontent.com/744b4f384fb7625c3bcad6f8b7047c4ec24f36c9b5f53f1006ea975207c70585/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f33323066643231342d376537342d346637312d616231302d6633663937396530316131302e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/320fd214-7e74-4f71-ab10-f3f979e01a10)[![Quality Score](https://camo.githubusercontent.com/bee04029074e276c44626f889273f3ca67b920f8aeb4a0a3a7a9cf745cdb6e81/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7061676572647574792e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/pagerduty)[![Code Coverage](https://camo.githubusercontent.com/77b19fef1dcaf5c694c94241fdae30e5097e755287396039f4ae2e4d4c3a449b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7061676572647574792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/pagerduty/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/9d1b858f2e144275edcb0f54d60f1bcd1e871937780c312c0d864c9e49bbd087/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f7061676572647574792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/pagerduty)

This package makes it easy to send notification events to [PagerDuty](https://www.pagerduty.com) with Laravel 5.5+, 6.x and 7.x

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the PagerDuty service](#setting-up-the-PagerDuty-service)
- [Usage](#usage)
    - [PagerDuty Setup](#pagerduty-setup)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install the package via composer:

```
composer require danhvo/pagerduty
```

Usage
-----

[](#usage)

Now you can use the channel in your `via()` method inside the Notification class.

```
use NotificationChannels\PagerDuty\PagerDutyChannel;
use NotificationChannels\PagerDuty\PagerDutyMessage;
use Illuminate\Notifications\Notification;

class SiteProblem extends Notification
{
    public function via($notifiable)
    {
        return [PagerDutyChannel::class];
    }

    public function toPagerDuty($notifiable)
    {
        return PagerDutyMessage::create()
            ->setSummary('There was an error with your site in the {$notifiable->service} component.');
    }
}
```

In order to let your Notification know which Integration should receive the event, add the `routeNotificationForPagerDuty` method to your Notifiable model.

This method needs to return the Integration Key for the service and integration to which you want to send the event.

```
public function routeNotificationForPagerDuty()
{
    return '99dc10c97a6e43c387bbc4f877c794ef';
}
```

### PagerDuty Setup

[](#pagerduty-setup)

On a PagerDuty Service of your choice, create a new Integration using the `Events API v2`.

[![Creating a new integration](doc/CreateNewIntegration.png)](doc/CreateNewIntegration.png)

The `Integration Key` listed for your new integration is what you need to set in the `routeNotificationForPagerDuty()` method.

[![List of Integrations with Keys](doc/ListIntegrations.png)](doc/ListIntegrations.png)

### Available Message methods

[](#available-message-methods)

- `resolve()`: Sets the event type to `resolve` to resolve issues.
- `setDedupKey('')`: Sets the `dedup_key` (required when resolving).
- `setSummary('')`: Sets a summary message on the event.
- `setSource('')`: Sets the event source; defaults to the `hostname`.
- `setSeverity('')`: Sets the event severity; defaults to `critical`.
- `setTimestamp('')`: Sets the `timestamp` of the event.
- `setComponent('')`: Sets the `component` of the event.
- `setGroup('')`: Sets the `group` of the event.
- `setClass('')`: Sets the `class`.
- `addCustomDetail('', '')`: Adds a key/value pair to the `custom_detail` of the event.

See the [PagerDuty v2 Events API documentation](https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2)for more information about what these options will do.

Usage
-----

[](#usage-1)

```
Notification::route('PagerDuty', '[my integration key]')->notify(new BasicNotification);
```

*When using `Notification::route` be sure to reference 'PagerDuty' as the Channel.*

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Luke Waite](https://github.com/lukewaite)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.6% 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 ~374 days

Recently: every ~241 days

Total

6

Last Release

1465d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.6.4

0.2.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc9df316aa4a09a2698cef2963ae06a4aa62d234657f3676d96596e0f1f33567?d=identicon)[danhvo](/maintainers/danhvo)

---

Top Contributors

[![lukewaite](https://avatars.githubusercontent.com/u/618130?v=4)](https://github.com/lukewaite "lukewaite (44 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (5 commits)")[![danhvogeocomply](https://avatars.githubusercontent.com/u/90378572?v=4)](https://github.com/danhvogeocomply "danhvogeocomply (4 commits)")[![karlos545](https://avatars.githubusercontent.com/u/9590468?v=4)](https://github.com/karlos545 "karlos545 (1 commits)")[![lukewaite-intouch](https://avatars.githubusercontent.com/u/132575883?v=4)](https://github.com/lukewaite-intouch "lukewaite-intouch (1 commits)")[![ziming](https://avatars.githubusercontent.com/u/679513?v=4)](https://github.com/ziming "ziming (1 commits)")

---

Tags

laravelnotificationslaravel-packagePagerDutyalertingnotification-channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danhvo-pagerduty/health.svg)

```
[![Health](https://phpackages.com/badges/danhvo-pagerduty/health.svg)](https://phpackages.com/packages/danhvo-pagerduty)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M162](/packages/spatie-laravel-health)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[salamwaddah/laravel-mandrill-driver

Mandrill notification channel for Laravel 9, 10, 11, 12, 13

1177.4k](/packages/salamwaddah-laravel-mandrill-driver)[laravel-notification-channels/rocket-chat

Rocket.Chat Notifications channel for Laravel 5.6+

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

PHPackages © 2026

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