zgabievi / laravel-smsoffice
SMSOffice Channel for Laravel Notifications
Requires
- php: ^7.0
- guzzlehttp/guzzle: ^6.3
- illuminate/notifications: ^5.5
- illuminate/support: ^5.5
Requires (Dev)
- mockery/mockery: ^0.9.9
- phpunit/phpunit: ^6.3
- squizlabs/php_codesniffer: ^2.3
This package is auto-updated.
Last update: 2021-01-30 02:52:09 UTC
README
Custom driver, SMSOffice, integration for Laravel Notifications
Table of Contents
Install
Via Composer
$ composer require zgabievi/laravel-smsoffice
If you do not run Laravel 5.5 (or higher), then follow next step:
// config/app.php 'providers' => [ ... Gabievi\LaravelSMSOffice\SMSOfficeServiceProvider::class, ],
If you do run the package on Laravel 5.5+, package auto-discovery takes care of the magic of adding the service provider.
Optional you can publish the configuration to provide an own service provider stub.
php artisan vendor:publish --provider="Gabievi\LaravelSMSOffice\SMSOfficeServiceProvider"
Configuration
// config/services.php ... 'smsoffice' => [ 'key' => env('SMSOFFICE_KEY'), 'sender' => 'JOHN' ], ...
Usage
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification; use Gabievi\LaravelSMSOffice\SMSOfficeMessage; use Gabievi\LaravelSMSOffice\SMSOfficeChannel; class Welcome extends Notification { // public function via($notifiable) { return [SMSOfficeChannel::class]; } // public function toSMSOffice($notifiable) { return SMSOfficeMessage::create('Welcome to the real world!'); } }
In your notifiable model, make sure to include a routeNotificationForSmsoffice() method, which return the phone number.
// public function routeNotificationForSmsoffice() { return $this->phone; }
Changelog
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email zura.gabievi@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.