apiseo/laravel-selfsms

Provides a simple SMS notification interface for Laravel 5.

1.0.0 2015-09-19 12:30 UTC

This package is not auto-updated.

Last update: 2021-05-14 23:44:27 UTC


README

Latest Stable Version License

###SMS Notification in Laravel 5.1

SelfSMS is a simple package that allows you to send SMS notifications through specific providers.

For now, only one provider is implemented: "Free Mobile" (French carrier)

Requirements

  • PHP 5.5.9+

Compatibility

  • Laravel 5.1.*

Installing

Use Composer to install it:

composer require apiseo/laravel-selfsms

Installing on Laravel

Add the Service Provider and Facade alias to your config/app.php :

'Apiseo\SelfSMS\Laravel\SelfSMSServiceProvider',

'SelfSMS' => 'Apiseo\SelfSMS\Laravel\SelfSMSFacade',

Then publish the default configuration file into config/selfsms.php using this command :

php artisan optimize
php artisan vendor:publish

Using It

Instantiate any provider directly (not recommanded)

use Apiseo\SelfSMS\FreeMobileSMSProvider;

$sms = new FreeMobileSMSProvider();

$sms->send('My message')

In Laravel you can use the IoC Container and the contract

$sms = app()->make('Apiseo\SelfSMS\SelfSMSProvider');

return $sms->send('My message')

Or Method Injection

use Apiseo\SelfSMS\SelfSMSProvider;

class NotificationController extends Controller {

	public function sendNotification(SelfSMSProvider $sms, $message)
	{
		return $sms->send($msg);
	}

}

Or the Facade

return \SelfSMS::send('My message')

Be Fluent

You can use the fluent interface to configure the provider and send your message :

$sms = \SelfSMS::make();

$sms->withMessage('My text message');

$sms->send();

Author

Stéphane B.

License

SelfSMS is licensed under the CeCILL-C License.

French version: HTML - Text

English version: HTML - Text

Contributing

Feel free to contribute. Any additional provider is welcome.