php
use NotificationChannels\GetStream\StreamChannel;
use NotificationChannels\GetStream\StreamMessage;
use Illuminate\Notifications\Notification;
class TestNotification extends Notification
{
public function via($notifiable)
{
return [StreamChannel::class];
}
public function toStream($notifiable)
{
return (new StreamMessage())
->actor(1)
->verb('like')
->object(3)
->foreignId('post:42');
}
}
php
/**
* Notification routing information for Stream.
*
* @return array
*/
public function routeNotificationForStream()
{
return [
'type' => 'user',
'id' => $this->id,
];
}
php
return (new StreamMessage())
->actor(1)
->verb('like')
->object(3);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.