Free SMS messaging for Laravel that uses SMS gateways to send messages.
- Laravel Notification channel support
$ composer require dmyers/phoney
/**
* Route notifications for the Phoney channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return array
*/
public function routeNotificationForPhoney($notification)
{
return [
'phone' => '15551234567',
'carrier' => 't-mobile',
'country' => 'United States',
];
}
use Dmyers\Phoney\{PhoneyChannel, PhoneyMessage};
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [
PhoneyChannel::class,
];
}
/**
* Get the phoney representation of the notification.
*
* @param mixed $notifiable
* @return \Dmyers\Phoney\PhoneyMessage
*/
public function toPhoney($notifiable)
{
$subject = 'SMS';
$body = 'Hello World!';
return PhoneyMessage::create($subject, $body);
}
use Dmyers\Phoney\Phoney;
$phoney = app(Phoney::class);
$phoney->sendMessage('15551234567', 'SMS', 'Hello World!', 't-mobile', 'United States');
use Dmyers\Phoney\Phoney;
$phoney = app(Phoney::class);
$phoney->carriers('United States');