composer require khonik/notifications
Khonik\Notifications\Providers\ChatsServiceProvider::class
php artisan vendor:publish --provider="Khonik\Notifications\NotificationsServiceProvider"
php artisan migrate
use Notifiable
в config/services.php:
'firebase'=> [
'key'=>env("FIREBASE_KEY")
]
и в .env
FIREBASE_KEY=
{
"status": "success",
"notifications": [
{
"id": 2,
"type": "email",
"title": "первое уведомление",
"text": "Привет всем!",
"sent_at": null,
"created_at": "2022-01-28T10:47:45.000000Z",
"updated_at": "2022-01-28T10:47:45.000000Z",
"users_count": 0
},
],
"total": 1,
"pages": 1
}
{
"type": "email",
"title": "первое уведомление",
"text": "Привет всем!"
}
{
"status": "success",
"notification": {
"type": "email",
"title": "первое уведомление",
"text": "Привет всем!",
"updated_at": "2022-01-28T10:47:10.000000Z",
"created_at": "2022-01-28T10:47:10.000000Z",
"id": 1
}
}
{
"type": "email",
"title": "первое уведомление!",
"text": "Привет всем!"
}
{
"status": "success",
"notification": {
"id": 3,
"type": "email",
"title": "первое уведомление!",
"text": "Привет всем!",
"sent_at": null,
"created_at": "2022-01-28T10:47:49.000000Z",
"updated_at": "2022-01-28T10:47:49.000000Z"
}
}
{
"status": "success",
}
{
"status": "success",
"users": [
{
"id": 1,
"name": "Nikita",
}
]
}
{
"users": [
1,
2,
3
]
}
{
"status": "success"
}
{
"status": "success"
}