Download the PHP package renderbit/laravel-sms without Composer
On this page you can find all versions of the php package renderbit/laravel-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-sms
Laravel SMS
A Laravel package to send transactional SMS messages through supported SMS gateways. Built with simplicity and robustness in mind.
๐ Features
- Simple API to send SMS via Facade or dependency injection
- API-based architecture โ works with any SMS gateway
- Template variable substitution (
{{ name }}placeholders) - Configurable query parameters, number field, and message field
- Disable SMS in non-production environments via config
- Laravel-native configuration, logging, and service provider
- PHP 8.1+ with Guzzle HTTP client
๐ฆ Installation
Laravel auto-discovers the service provider. No manual registration needed.
๐ Configuration
Publish the configuration file:
This will publish config/sms.php. Example contents:
Update your .env file:
Note: SMS sending is disabled by default. Set
SMS_ENABLED=truein your.envorsms.enabledin config to enable it.
โ๏ธ Usage
Send an SMS using the Facade or SmsClient:
Using Facade
Using Dependency Injection
Template Variables
You can pass replacement values in a third parameter:
โ Return Value
The send method returns true on success (or when SMS is disabled) and false on failure:
Errors are logged automatically via Laravel's logger.
๐งช Testing
Run the package's test suite:
The suite covers unit tests (SmsClient, SmsServiceProvider, Facade) and feature tests (integration through the Laravel container), 22 tests with 51 assertions.
To control SMS behavior in your own tests:
๐ Project Structure
๐ค Contributing
Pull requests are welcome! For major changes, please open an issue first to discuss what you'd like to change.
๐ License
This package is open-sourced software licensed under the MIT license.