Download the PHP package 1naturalway/laravel-sms without Composer

On this page you can find all versions of the php package 1naturalway/laravel-sms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-sms

Laravel SMS

A driver-based SMS abstraction layer for Laravel, following the same architectural pattern as Laravel's built-in Mail system. Swap between Twilio, logging, or a null driver with a single config change.

Installation

Publish the config file:

Configuration

Set the driver and credentials in your .env file:

Twilio

Requires the Twilio SDK:

Log

Writes every SMS to a Laravel log channel. Useful for debugging and verifying sends in staging or CI.

Null

Silently discards all messages. This is the default — no accidental sends in development.

Usage

Basic Send

Every send() call returns an SmsResult DTO with these properties:

Property Type Description
messageId ?string Provider message ID (e.g., Twilio SID)
status ?string Provider status (e.g., queued, captured, logged)
to ?string Recipient number
from ?string Sender number
body ?string Message body
mediaCount ?int Number of media attachments (Twilio)
mediaUrls array URLs of attached media (Twilio MMS)
raw array Full raw response from the provider

Use $result->successful() to check if the message was accepted — returns true when messageId is present. Use $result->hasMedia() to check if media was attached. The null driver always returns an unsuccessful result since nothing was sent.

Error Handling

The Twilio driver wraps API errors into typed SmsException instances so you can handle specific failure modes:

SmsException extends RuntimeException, so uncaught errors will still surface normally in your exception handler.

With Options

Driver Switching

Dependency Injection

Testing

The package ships with a FakeSmsProvider that captures all messages in memory, just like Laravel's Mail::fake().

Available Assertions

Method Description
assertSentTo($number, $bodyContains?) A message was sent to this number, optionally containing text
assertNothingSent() No messages were sent
assertSentCount($n) Exactly N messages were sent
assertSentToWithBody($number, $callback) A message to this number passes the callback (receives SmsResult)
getSent() Returns an array of SmsResult objects

Custom Drivers

Register a custom driver using extend(), typically in a service provider's boot() method:

Add the driver config to config/sms.php:

Your custom provider must implement the SmsProvider interface:

UAT Strategy

For UAT environments, we recommend Log driver:

This layered approach guarantees:

  1. Production uses Twilio (or your chosen carrier) via SMS_DRIVER=twilio
  2. UAT uses logs to capture and inspect messages
  3. Development and CI use null or log — zero accidental sends

License

MIT


All versions of laravel-sms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4 || ^8.5
illuminate/support Version ^12.0 || ^13.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/log Version ^12.0 || ^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package 1naturalway/laravel-sms contains the following files

Loading the files please wait ...