Skip to content
Sybase 365 notification channel with Laravel.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.editorconfig
.gitattributes
.gitignore
.scrutinizer.yml
.styleci.yml
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

Laravel Sybase Notification Channel

Latest Version on Packagist Build Status Total Downloads

Sybase 365 notification channel with Laravel.

Installation

You can install the package via composer:

composer require yish/sybase-notification-channel

Usage

Creating notification:

$ php artisan make:notification SendMessage

Notify the service and send request

Basic

Notification::route('sybase', $phone)->notify(new \App\Notifications\SendMessage);

Or you can construct the properties:

Notification::route('sybase', $phone)
->notify(new \App\Notifications\SendMessage(
    "Hi, here is yours",
    "this is content."
));

Next, navigate to App\Notifications\SendMessage.php, set driver:

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);
    }
    ....

Finally, you must be set service account and password, add a few configuration options to your config/services.php

'sybase' => [
    'account' => env('SYBASE_ACCOUNT'),
    'password' => env('SYBASE_PASSWORD'),
    'endpoint' => env('SYBASE_ENDPOINT'),
],

Advanced

In some cases, you want to customize the recipient or automatically sending:

<?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;
    }
}

Finally, you can use:

$guest->notify(new SendMessage('Hello', 'world'));

Security

If you discover any security related issues, please email mombuartworks@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.