PHP code example of yish / sybase-notification-channel

1. Go to this page and download the library: Download yish/sybase-notification-channel 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/ */

    

yish / sybase-notification-channel example snippets

 bash
$ php artisan make:notification SendMessage
 php
Notification::route('sybase', $phone)->notify(new \App\Notifications\SendMessage);
 php
Notification::route('sybase', $phone)
->notify(new \App\Notifications\SendMessage(
    "Hi, here is yours",
    "this is content."
));
 php
use Yish\Notifications\Messages\SybaseMessage;
class SendMessage extends Notification
{
    use Queueable;

    public $subject;

    public $content;

    public function __construct($subject, $content)
    {
        $this->subject = $subject;
        $this->content = $content;
    }

    public function via($notifiable)
    {
        return ['sybase'];
    }
    
    public function toSybase($notifiable)
    {
        return (new SybaseMessage)
                ->subject($this->subject)
                ->content($this->content);
    }
    ....
 php


namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class Guest extends Authenticatable
{
    use Notifiable; 
    
    public function routeNotificationForSybase($notification)
    {
        return $this->mobile;
    }
}
 php
$guest->notify(new SendMessage('Hello', 'world'));