PHP code example of laravel-notification-channels / workplace

1. Go to this page and download the library: Download laravel-notification-channels/workplace library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

laravel-notification-channels / workplace example snippets

 php
use NotificationChannels\Workplace\WorkplaceChannel;
use NotificationChannels\Workplace\WorkplaceMessage;
use Illuminate\Notifications\Notification;

class WorkplaceNotification extends Notification
{
    public function via($notifiable)
    {
        return [WorkplaceChannel::class];
    }

    public function toWorkplace($notifiable)
    {
        return new WorkplaceMessage('# Laravel Notification Channels are awesome!');
    }
}
 php
class TestNotifiable
{
    use \Illuminate\Notifications\Notifiable;

    public function routeNotificationForWorkplace()
    {
        return 'https://graph.facebook.com/<groupId>/feed?access_token=<access_token>';
    }
}