Skip to content
This repository has been archived by the owner on Oct 27, 2019. It is now read-only.

Submit pull requests here for new notification channels

License

Notifications You must be signed in to change notification settings

teraone/new-channels

 
 

Repository files navigation

Lox24 Push Notification Channel for Laravel 5.3

Latest Version on Packagist Software License Build Status StyleCI SensioLabsInsight Quality Score Code Coverage Total Downloads

This package makes it easy to send notifications using Lox24 with Laravel 5.3.

Contents

Installation

You can install the package via composer:

composer require laravel-notification-channels/lox24

Setting up the Lox24 service

Add your Lox24 Account ID and your Lox24 password to your broadcasting config:

// config/broadcasting.php

    'connections' =>
        'lox24' => [
            'accountId' => env('LOX24_ACCOUNT_ID'),
            'password' => env('LOX24_PASSWORD'),
            'from' => env('LOX24_FROM'), // optional sender name
        ]

Usage

Now you can use the channel in your via() method inside the notification:

use NotificationChannels\Lox24\Lox24Channel;
use NotificationChannels\Lox24\Lox24Message;
use Illuminate\Notifications\Notification;

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

    public function toLox24($notifiable)
    {
        return Lox24Message::create()
                    ->setText("Your account was approved!")
                    ->setFrom('YOUR SITE');
    }
}

In order to let your Notification know to which mobile phone number to send the SMS add routeNotificationForLox24 method to your Notifiable model.

You must return phone number.

public function routeNotificationForLox24()
{
    return $this->mobile_phone; // For examle 0049123456789
}

Do not forget to add the Service Provider:

    NotificationChannels\Lox24\Lox24ServiceProvider::class

Available methods

  • setText('hello you!'): Accepts a string value for the SMS Text.
  • setTo('0049123456789'): Accepts a string value with the receiver phone number.
  • setFrom('sendername'): Accepts a string value (max 11 characters) with a sender name which will be displayed on receivers phone as sender
  • testOnly(): Can be used for testing, no SMS will be sent
  • sendAt(\DateTime $time): Can be used to schedule sending

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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

About

Submit pull requests here for new notification channels

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%