yacinediaf/laravel-notifyme
最新稳定版本:v1.0.4
Composer 安装命令:
composer require yacinediaf/laravel-notifyme
包简介
This is my package laravel-notifyme
README 文档
README
This package allows you to notify your users through the firebase cloud messaging technique in order to notify them using there device notification on both IOS or ANDROID with ease.
Before start working with this package it is recommended to read the following article to know how things works under the hood. Notify me! Using Laravel and FCM.
Requirements
You need to have laravel sanctum installed. if you don't installed it yet do it using the following command
composer require laravel/sanctum
Installation
- You can install the package via composer:
composer require yacinediaf/laravel-notifyme
- You can publish and run the migrations with:
php artisan vendor:publish --tag="migrations"
php artisan migrate
Don't forget to add the hasDevice trait to your User model
- Add the FIREBASE_CREDENTIALS to your .env file you can read the following article in order to know where to get this file. Notify me! Using Laravel and FCM.
FIREBASE_CREDENTIALS=storage/app/private/googleaccountservice.json
Usage
- Make sure the current user is authenticated.
- Generate the FCM token on the client side from your mobile client (IOS, ADNROID) by installing firebase package compatible with the language you're using for example Flutter.
- Save the generated FCM token for the current user with the current device by Posting to this endpoint /api/save_device_token
- You need to include in the body parameter of the request the following data:
[
'user_id' => ['required', 'exists:users,id'],
'device_token' => ['required', 'string'],
'device_info' => ['required', 'string'], //Iphone 15 pro max
];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-30