| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace App\Notifications;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Notifications\Messages\MailMessage;
- use Illuminate\Notifications\Notification;
- class FireBaseNotification extends Notification
- {
- use Queueable;
- /**
- * Create a new notification instance.
- */
- public function __construct()
- {
- //
- }
- /**
- * Get the notification's delivery channels.
- *
- * @return array<int, string>
- */
- public function via(object $notifiable): array
- {
- return ['fcm'];
- }
- public function toFcm(object $notifiable): array
- {
- return [
- 'to' => $notifiable->token_fcm,
- 'notification' => [
- 'title' => 'Notification Title',
- 'body' => 'Notification Body',
- 'image' => config('app.addr') . '/logo.png', // Optional image URL
- ],
- ];
- }
- }
|