demian/laravel-notifications-gcm
Larablocks Analysis
demian/laravel-notifications-gcm works with Laravel 5 (latest release 0.0.3, Nov 9, 2016), which reached end of life: no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: Nov 9, 2016)
- 0 downloads a month (needs 10,000)
- 0 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Nov 9, 2016.
- No releases in the last 12 months.
- First released: Aug 27, 2016.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require demian/laravel-notifications-gcm |
|
| Latest Version: | 0.0.3 |
| PHP: | >=5.5 |
| Laravel: | 5 |
| License: | MIT |
| Last Updated: | Nov 9, 2016 |
| Links: | GitHub · Packagist |
Laravel GCM (Google Cloud Messaging) Notification Channel
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, so please read that documentation for more information.
Contents
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
You need to register for a server key for Google Cloud Messaging for your App in the Google API Console: https://console.cloud.google.com/apis/
Add the API key to your configuration in config/broadcasting.php
'connections' => [
....
'gcm' => [
'key' => env('GCM_KEY'),
],
...
]
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
- title($str)
- message($str)
- badge($integer)
- priorty(
GcmMessage::PRIORITY_NORMALorGcmMessage::PRIORITY_HIGH) - data($key, $mixed)
- action($action, $params) (Will set an
actiondata key)
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email info@fruitcake.nl instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 0.0.3 | >=5.5 | ^5.1| | MIT | |
| 0.0.2 | >=5.5 | ^5.1| | MIT | |
| 0.0.1 | >=5.5 | ^5.1| | MIT |