Edit File: LikeNotification.php
<?php namespace App\Notifications; use App\Traits\FirebaseTrait; use Illuminate\Bus\Queueable; use Illuminate\Notifications\Notification; class LikeNotification extends Notification { use Queueable, FirebaseTrait; private $data; public function __construct($like, $title_ar, $title_en, $body_ar, $body_en, $type) { $this->data = [ 'user_id' => $like->user_id, 'title_ar' => $title_ar, 'title_en' => $title_en, 'body_ar' => $body_ar, 'body_en' => $body_en, 'type' => $type, ]; } public function via($notifiable) { return ['database']; } public function toArray($notifiable) { if ($notifiable->is_notify) { $this->sendFcmNotification($notifiable->devices(), $this->data, $notifiable->lang); } return $this->data; } }
Back to File Manager