{"id":15183060,"url":"https://github.com/besanek/laravel-firebase-notifications","last_synced_at":"2025-10-26T22:31:50.330Z","repository":{"id":62493474,"uuid":"193714290","full_name":"besanek/laravel-firebase-notifications","owner":"besanek","description":"Thin layer for integrate Firebase Messaging as Laravel Notifications","archived":false,"fork":false,"pushed_at":"2024-04-24T10:18:36.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T06:31:52.485Z","etag":null,"topics":["firebase","firebase-messaging","laravel","laravel-5-package","notifications"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/besanek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-25T13:35:19.000Z","updated_at":"2024-04-24T10:17:49.000Z","dependencies_parsed_at":"2024-04-24T11:42:43.395Z","dependency_job_id":null,"html_url":"https://github.com/besanek/laravel-firebase-notifications","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besanek%2Flaravel-firebase-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besanek%2Flaravel-firebase-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besanek%2Flaravel-firebase-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/besanek%2Flaravel-firebase-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/besanek","download_url":"https://codeload.github.com/besanek/laravel-firebase-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238408518,"owners_count":19467105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firebase-messaging","laravel","laravel-5-package","notifications"],"created_at":"2024-09-27T17:01:24.653Z","updated_at":"2025-10-26T22:31:50.042Z","avatar_url":"https://github.com/besanek.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Firebase Notifications\n\nThin layer for integrate Firebase Messaging as Laravel Notifications\n\n## Requirement\n\n-   PHP \u003e= 8.1\n-   Laravel = 10.x\n\n## Installing\n\n```shell\n$ composer require \"besanek/laravel-firebase-notifications\"\n```\n\nThis is all, thanks to the Package Autodiscover.\n\n## Setup\n\nPlease follow configuration guide of [kreait/laravel-firebase](https://github.com/kreait/laravel-firebase#configuration)\n\n\n## Basic Usage\n\nAdd new method `routeNotificationForFirebase` to your notifiable entity, witch returns device id.\n\n```php\n    /**\n     * It could be one device\n     */\n    public function routeNotificationForFirebase()\n    {\n        return $this-\u003edevice_id;\n    }\n    \n    /**\n     * Or you can return array for multicast\n     */\n    public function routeNotificationForFirebase()\n    {\n        return $this-\u003edevices()-\u003eget()-\u003epluck('id');\n    }\n```\n\nIn Notification entity you should add *firebase* to `via()` method.\n\n```php\n    public function via(): array\n    {\n        return ['firebase', /* 'email', 'database', 'etc...'*/];\n    }\n```\n\nAnd you can construct `CloudMessage` into `toFirebase()` method.\n\n```php\n    public function toFirebase(): Messaging\\CloudMessage\n        $notification = Messaging\\Notification::create('I \u003c3 laravel', 'It is true');\n        return Messaging\\CloudMessage::new()-\u003ewithNotification($notificatin);\n    }\n```\nPlease look into the [official PHP SDK documentation](https://firebase-php.readthedocs.io/en/latest/cloud-messaging.html#adding-a-notification) for the full use of all possibilities.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbesanek%2Flaravel-firebase-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbesanek%2Flaravel-firebase-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbesanek%2Flaravel-firebase-notifications/lists"}