<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
besanek / laravel-firebase-notifications example snippets
/**
* It could be one device
*/
public function routeNotificationForFirebase()
{
return $this->device_id;
}
/**
* Or you can return array for multicast
*/
public function routeNotificationForFirebase()
{
return $this->devices()->get()->pluck('id');
}
public function via(): array
{
return ['firebase', /* 'email', 'database', 'etc...'*/];
}
public function toFirebase(): Messaging\CloudMessage
$notification = Messaging\Notification::create('I <3 laravel', 'It is true');
return Messaging\CloudMessage::new()->withNotification($notificatin);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.