-
-
Notifications
You must be signed in to change notification settings - Fork 92
Notification
hexters1 edited this page Apr 3, 2022
·
1 revision
Here you can send notifications at once to all admin users listed in config/ladmin.php
.
return [
. . .
'user' => \App\Models\User::class,
. . .
];
And here you can send notifications to only one user. see example below.
Sending broadcasting messages to all registered admins
ladmin()
->notification()
->setTitle('New Invoice')
->setLink('http://project.test/invoice/31eb6d58-3622-42a4-9206-d36e7a8d6c06')
->setDescription('Pay invoice #123455')
->setImageLink('http://porject.test/icon-invoice.ong')
->setGates(['ladmin.blog.reviewer', 'ladmin.blog.writer'])
->send()
Sending messages to only one user, remember that this message can only be sent to users who are initialized to the Illuminate\Foundation\Auth\User
class.
ladmin()
->notification( User::first() )
->setTitle('New Invoice')
->setLink('http://project.test/invoice/31eb6d58-3622-42a4-9206-d36e7a8d6c06')
->setDescription('Pay invoice #123455')
->setImageLink('http://porject.test/icon-invoice.ong')
->setGates(['ladmin.blog.reviewer', 'ladmin.blog.writer'])
->send()
Option | Type | required | Note |
---|---|---|---|
notification |
? \Illuminate\Foundation\Auth\User | YES | Value is not required |
setTitle |
String | YES | - |
setLink |
String | YES | - |
setImageLink |
String | NO | - |
setDescription |
String | YES | - |
setGates |
Array | NO | Default all gates |
http://localhost:8000/administrator/notification
Notifications will broadcast on a private channel formatted using a {notifiable}.{id} convention. View complete Documentation
Echo.private('ladmin.notification.' + userId)
.notification((notification) => {
console.log(notification.type);
});
- #1 Create Module
- #2 Create Menu
- #3 Route
- #4 Create DataTables
- #5 Template Layout
- #6 Create Model
- #7 Create Command
- #8 Create Component
- #9 Broadcast Notification
- #10 Group Search
- #11 Flashing Message
- #12 Compiling Assets (ViteJs)
- #13 Ladmin Option
- #14 Utility & Helpers
- #15 Vendor Publish
- #16 Custom Style
- #17 Ladmin Awesome
- #18 Make Money