PHPackages                             yamad/laravel-fcm - 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. yamad/laravel-fcm

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

yamad/laravel-fcm
=================

Firebase Cloud Messaging API (V1) client for Laravel

v0.1.0(yesterday)02↑2900%MITPHPPHP ^8.1

Since Aug 24Pushed yesterdayCompare

[ Source](https://github.com/yamader/laravel-fcm)[ Packagist](https://packagist.org/packages/yamad/laravel-fcm)[ RSS](/packages/yamad-laravel-fcm/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

yamad/laravel-fcm
=================

[](#yamadlaravel-fcm)

Firebase Cloud Messaging API (V1) client for Laravel 10-13.

Uses [google/auth](https://github.com/google/auth) for OAuth 2.0 and [Guzzle](http://docs.guzzlephp.org/) for HTTP.

Requirements
------------

[](#requirements)

- PHP ^8.1
- Laravel ^10|^11|^12|^13

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

[](#installation)

```
composer require yamad/laravel-fcm
```

The service provider and `Fcm` facade alias are discovered automatically.

Publish the config file:

```
php artisan vendor:publish --tag=fcm-config
```

```
# .env
FCM_PROJECT_ID=your-firebase-project-id
FCM_CREDENTIALS=/absolute/path/to/service-account.json   # optional
```

`FCM_CREDENTIALS` を未設定にすると Application Default Credentials(`GOOGLE_APPLICATION_CREDENTIALS` 環境変数や GCE/GKE のメタデータ)にフォールバックします。

Usage
-----

[](#usage)

```
use YamaD\LaravelFcm\Facades\Fcm;

// Send to a device registration token
$response = Fcm::send([
    'token' => $deviceToken,
    'notification' => [
        'title' => 'Hello',
        'body' => 'World',
    ],
]);

echo $response['name']; // projects/{project_id}/messages/{message_id}

// Send to a topic
Fcm::send([
    'topic' => 'news',
    'notification' => ['title' => 'Breaking news'],
]);

// Dry run (validation only, no delivery)
Fcm::send($message, validateOnly: true);
```

DI injection also works:

```
use YamaD\LaravelFcm\FcmClient;

public function handle(FcmClient $fcm)
{
    $fcm->send([...]);
}
```

The `$message` payload is passed to the FCM v1 API as-is. See the [official reference](https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message) for available fields.

Errors: HTTP 4xx/5xx throws `GuzzleHttp\Exception\RequestException` (the response is attached).

Testing
-------

[](#testing)

```
composer install
vendor/bin/phpunit
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

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

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/156887?v=4)[Jason Yamada-Hanff](/maintainers/yamad)[@yamad](https://github.com/yamad)

---

Tags

laravelpushnotificationfirebaseFCM

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yamad-laravel-fcm/health.svg)

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

PHPackages © 2026

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