2017 © Pedro Peláez
 

library toplusmslaravel

Laravel Notification for toplusmsapi.com

image

topcu/toplusmslaravel

Laravel Notification for toplusmsapi.com

  • Tuesday, April 25, 2017
  • by topcu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

toplusmsapi SMS Notifications for Laravel 5.3

Introduction

This is a simple Notifications channel for Laravel., (*1)

Installation

First, you'll need to require the package with Composer:, (*2)

composer require topcu/toplusmslaravel

Aftwards, run composer update from your command line., (*3)

Then, update config/app.php by adding an entry for the service provider., (*4)

'providers' => [
    // ...
    Topcu\TopluSms\TopluSmsProvider::class,
];

Then, update config/services.php by adding your toplusms credentials., (*5)

return [
   // ...
    ,
        'toplusms' => [
            'username' => env('TOPLUSMS_USERNAME'),
            'password' => env('TOPLUSMS_PASSWORD'),
            'from' => env('TOPLUSMS_FROM', null), // Can be ovverdiden with $message->from() 
        ]
    // ...
];

Usage

Routing sms notifications

In order to send sms messages, you need to specify recipient for each notifiable entity. For instance in app/user.php, (*6)

    // ...
    public function routeNotificationForSms(){
        return $this->phone;
    }
    // ...

Sending notification

via Method

In your notification class you can define channel as:, (*7)

    // ...
    public function via($notifiable)
    {
        return ['sms'];
    }
    // ...

toSMS Method

You also need to define, toSms method. You can: 1. Send a simple string as:, (*8)

    // ...
    public function toSms($notifiable)
    {
        return "Hello World!";
    }
    // ...
  1. Or define a from (sender) to override config: php // ... public function toSms($notifiable) { $message = new SmsMessage("Hello World"); $message->from("5xxxxxxxxx"); return $message; } // ...

The Versions

25/04 2017

dev-master

9999999-dev

Laravel Notification for toplusmsapi.com

  Sources   Download

The Requires

 

by Toplusms Laravel

25/04 2017

v1.0.2

1.0.2.0

Laravel Notification for toplusmsapi.com

  Sources   Download

The Requires

 

by Toplusms Laravel

20/04 2017

v1.0.1

1.0.1.0

Laravel Notification for toplusmsapi.com

  Sources   Download

The Requires

 

by Toplusms Laravel

18/04 2017

v1.0

1.0.0.0

Laravel Notification for toplusmsapi.com

  Sources   Download

The Requires

 

by Toplusms Laravel