2017 © Pedro PelĂĄez
 

library authy

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

image

laravel-notification-channels/authy

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  • Friday, July 20, 2018
  • by Omranic
  • Repository
  • 4 Watchers
  • 52 Stars
  • 6,082 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 13 Forks
  • 0 Open issues
  • 13 Versions
  • 9 % Grown

The README.md

Authy Notification Channel for Laravel

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens., (*1)

Packagist Scrutinizer Code Quality StyleCI Travis License, (*2)

Authy Notifications, (*3)

Table Of Contents

Usage

  1. Install the package via composer:, (*4)

    composer require laravel-notification-channels/authy
    
  2. This package requires rinvex/laravel-authy package, so before proceeding make sure to follow up its installation steps first., (*5)

  3. Next, to route Authy notifications to the proper entity, define a routeNotificationForAuthy method on your notifiable entity. This should return the Authy Id to which the notification should be sent. Example:, (*6)

    /**
     * Route notifications for the authy channel.
     *
     * @return int
     */
    public function routeNotificationForAuthy()
    {
        return $this->authy_id;
    }
    

    Note: as you might thought, this requires an authy_id attribute in your notifiable entity, for which you may need to create an additional field in the database table., (*7)

  4. Now you can create notifications that use Authy channel as follows:, (*8)

    // app/Notifications/PhoneVerificationNotification.php
    
    namespace App\Notifications;
    
    use Illuminate\Notifications\Notification;
    use NotificationChannels\Authy\AuthyChannel;
    use NotificationChannels\Authy\AuthyMessage;
    
    class PhoneVerificationNotification extends Notification
    {
        /**
         * The notification method (sms/call).
         *
         * @var string
         */
        public $method;
    
        /**
         * Determine whether to force the notification over cellphone network.
         *
         * @var bool
         */
        public $force;
    
        /**
         * The notification message action.
         *
         * @var string
         */
        public $action;
    
        /**
         * The notification message action message.
         *
         * @var string
         */
        public $actionMessage;
    
        /**
         * Create a notification instance.
         *
         * @param string $method
         * @param bool   $force
         * @param string $action
         * @param string $actionMessage
         *
         * @return void
         */
        public function __construct($method = 'sms', $force = false, $action = null, $actionMessage = null)
        {
            $this->method = $method;
            $this->force = $force;
            $this->action = $action;
            $this->actionMessage = $actionMessage;
        }
    
        /**
         * Get the notification's channels.
         *
         * @param mixed $notifiable
         *
         * @return array|string
         */
        public function via($notifiable)
        {
            return [AuthyChannel::class];
        }
    
        /**
         * Build the Authy representation of the notification.
         *
         * @return \NotificationChannels\Authy\AuthyMessage
         */
        public function toAuthy()
        {
            $message = AuthyMessage::create()->method($this->method);
    
            if ($this->force) {
                $message->force();
            }
    
            if ($this->action) {
                $message->action($action);
            }
    
            if ($this->actionMessage) {
                $message->actionMessage($actionMessage);
            }
    
            return $message;
        }
    }
    
  5. Finally you can consume the notification as follows:, (*9)

    $this->notify(new \App\Notifications\PhoneVerificationNotification('sms', true));
    

    Note: don't forget to read through Authy TOTP API documentation for further information., (*10)

  6. Done!, (*11)

Upgrade

  • Upgrading To v2.x From v1.x, (*12)

    API implementation is 100% backward compatible, but sandbox API has been dropped since it's officially deprecated. Also note that PHP7 is now required., (*13)

Changelog

Refer to the Changelog for a full history of the project., (*14)

Support

The following support channels are available at your fingertips:, (*15)

Contributing & Protocols

Thank you for considering contributing to this project! The contribution guide can be found in CONTRIBUTING.md., (*16)

Bug reports, feature requests, and pull requests are very welcome., (*17)

Security Vulnerabilities

If you discover a security vulnerability within this project, please send an e-mail to security@rinvex.com. All security vulnerabilities will be promptly addressed., (*18)

About Rinvex

Rinvex is a software solutions startup, specialized in integrated enterprise solutions for SMEs established in Alexandria, Egypt since June 2016. We believe that our drive The Value, The Reach, and The Impact is what differentiates us and unleash the endless possibilities of our philosophy through the power of software. We like to call it Innovation At The Speed Of Life. That’s how we do our share of advancing humanity., (*19)

Trademarks

License

This software is released under The MIT License (MIT)., (*20)

(c) 2016-2020 Rinvex LLC, Some rights reserved., (*21)

The Versions

20/07 2018

dev-develop

dev-develop https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

21/05 2018

dev-analysis-8KlYyD

dev-analysis-8KlYyD https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

21/05 2018

dev-analysis-z36N6L

dev-analysis-z36N6L https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

21/05 2018

dev-analysis-8KlYl6

dev-analysis-8KlYl6 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

18/02 2018

dev-master

9999999-dev https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

18/02 2018

v3.0.0

3.0.0.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

20/12 2016

v2.0.0

2.0.0.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

17/11 2016

v1.0.0

1.0.0.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

17/11 2016

v0.0.5

0.0.5.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

17/11 2016

v0.0.4

0.0.4.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

24/10 2016

v0.0.3

0.0.3.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

24/10 2016

v0.0.2

0.0.2.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex

15/10 2016

v0.0.1

0.0.1.0 https://rinvex.com

Authy notification channel for Laravel, with the ability to send in-app, sms, and call verification tokens.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel sms token verification phone call authy rinvex