dmn / txtbox
Txtbox package
v1.0.5
2023-08-01 08:40 UTC
Requires
- guzzlehttp/guzzle: ^7.7
Requires (Dev)
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.2
README
install
composer require dmn/pkg-txtbox
configuration
txtbox.php
<?php return [ 'base_uri' => env('TXTBOX_BASE_URI', 'https://ws-live.txtbox.com/'), 'api_key' => env('TXTBOX_API_KEY'), 'guzzle' => [], ];
service provider
Dmn\Txtbox\ServiceProvider::class
example
<?php namespace Dmn\Txtbox\Examples; use Dmn\Txtbox\Channels\Txtbox; use Dmn\Txtbox\Messages\TxtboxMessage; use Illuminate\Notifications\Notification; class SmsNotification extends Notification { /** * Get the notification channels. * * @param mixed $notifiable * @return array|string */ public function via($notifiable) { return [Txtbox::class]; } /** * Get Txtbox message * * @param mixed $notifiable * * @return TxtboxMessage */ public function toTxtbox($notifiable): TxtboxMessage { return (new TxtboxMessage()) ->setMobileNumber($notifiable['mobile_number']) ->setMessage('This is a sample sms from package channel txtbox'); } }