PHPackages                             demian/laravel-notifications-gcm - 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. demian/laravel-notifications-gcm

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

demian/laravel-notifications-gcm
================================

Android GCM Push Notification Channel

0.0.3(9y ago)020MITPHPPHP &gt;=5.5

Since Aug 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/DemianD/gcm)[ Packagist](https://packagist.org/packages/demian/laravel-notifications-gcm)[ Docs](https://github.com/laravel-notification-channels/gcm)[ RSS](/packages/demian-laravel-notifications-gcm/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (2)Dependencies (8)Versions (5)Used By (0)

Laravel GCM (Google Cloud Messaging) Notification Channel
=========================================================

[](#laravel-gcm-google-cloud-messaging-notification-channel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/241be38daedd6f3aa3240856751142a1433bd70cb04071a8ea7267745fa55365/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f67636d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/gcm)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/bf112188679db0328fdb3eebfc59e73f7c497aac68b6276793823ca82a163771/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f67636d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/gcm)[![StyleCI](https://camo.githubusercontent.com/67637887d7eb5e778088041abcd0d6401f0a4b14ad2ac5b8b77d5511df13c36f/68747470733a2f2f7374796c6563692e696f2f7265706f732f36363434393435372f736869656c64)](https://styleci.io/repos/66449457)[![SensioLabsInsight](https://camo.githubusercontent.com/fa17d00b1bbe12475071d080accd8da12a536e4a5e443dbad54898f6170bf8bd/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f35366534623863322d336361352d346433302d393234612d6362653631333166616162632e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/56e4b8c2-3ca5-4d30-924a-cbe6131faabc)[![Quality Score](https://camo.githubusercontent.com/655b62e1e1a5776a112402c22fdbd132bc4b5683102d871b630426ae63be931c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f67636d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/gcm)[![Code Coverage](https://camo.githubusercontent.com/f050e5b4d872283c9474bed7797103e881c61fec30d0228150f7836836c08abf/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f67636d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/gcm/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/c24720c8758ea7664299ef2ed77c0161232290446a7c61c882a803ffd53a62b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f67636d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/gcm)

This package makes it easy to send notifications using Google Cloud Messaging (GCM) with Laravel 5.3.

This package is based on [ZendService\\Google\\Gcm](https://framework.zend.com/manual/2.4/en/modules/zendservice.google.gcm.html), so please read that documentation for more information.

Contents
--------

[](#contents)

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

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

[](#installation)

Install this package with Composer:

```
composer require laravel-notification-channels/gcm

```

Register the ServiceProvider in your config/app.php:

```
NotificationChannels\Gcm\GcmServiceProvider::class,

```

### Setting up the GCM service

[](#setting-up-the-gcm-service)

You need to register for a server key for Google Cloud Messaging for your App in the Google API Console:

Add the API key to your configuration in config/broadcasting.php

```
'connections' => [
  ....
  'gcm' => [
      'key' => env('GCM_KEY'),
  ],
  ...
]

```

Usage
-----

[](#usage)

You can now send messages to GCM by creating a GcmMessage:

```
use NotificationChannels\Gcm\GcmChannel;
use NotificationChannels\Gcm\GcmMessage;
use Illuminate\Notifications\Notification;

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

    public function toGcm($notifiable)
    {
        return GcmMessage::create()
            ->badge(1)
            ->title('Account approved')
            ->message("Your {$notifiable->service} account was approved!");
    }
}
```

In your `notifiable` model, make sure to include a `routeNotificationForGcm()` method, which return one or an array of tokens.

```
public function routeNotificationForGcm()
{
    return $this->gcm_token;
}
```

### Available methods

[](#available-methods)

- title($str)
- message($str)
- badge($integer)
- priorty(`GcmMessage::PRIORITY_NORMAL` or `GcmMessage::PRIORITY_HIGH`)
- data($key, $mixed)
- action($action, $params) (Will set an `action` data key)

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)

- [Fruitcake](https://github.com/fruitcake)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~37 days

Total

3

Last Release

3520d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/125278?v=4)[Demian Glait](/maintainers/Demian)[@demian](https://github.com/demian)

---

Top Contributors

[![TechGuard](https://avatars.githubusercontent.com/u/677174?v=4)](https://github.com/TechGuard "TechGuard (9 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (7 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (5 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (2 commits)")[![LonnyX](https://avatars.githubusercontent.com/u/10662320?v=4)](https://github.com/LonnyX "LonnyX (1 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/demian-laravel-notifications-gcm/health.svg)

```
[![Health](https://phpackages.com/badges/demian-laravel-notifications-gcm/health.svg)](https://phpackages.com/packages/demian-laravel-notifications-gcm)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M125](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M337](/packages/psalm-plugin-laravel)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M284](/packages/laravel-horizon)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M123](/packages/roots-acorn)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2022.1M6](/packages/laravel-notification-channels-apn)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2588.1M15](/packages/laravel-notification-channels-twilio)

PHPackages © 2026

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