Download the PHP package shetabit/sms without Composer

On this page you can find all versions of the php package shetabit/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 sms

Laravel Sms Gateway

Latest Version on Packagist Total Downloads on Packagist Tests Code Style Static Analysis Code Coverage

This is a Laravel package for sms gateway integration. This package requires PHP 8.4+ and supports Laravel 12 and Laravel 13.

Donate me if you like this package :sunglasses: :bowtie:

This package works with multiple drivers, and you can create custom drivers if you can't find them in the current drivers list below.

List of contents

List of available drivers

Driver Gateway Needs
clockwork Clockwork composer require mediaburst/clockworksms
farazsms Faraz SMS
kavenegar Kavenegar composer require kavenegar/php
linkmobility LINK Mobility
melipayamak Melipayamak composer require melipayamak/php
smsgatewayme SMSGateway.me composer require smsgatewayme/client
smsir SMS.ir
sns Amazon SNS composer require aws/aws-sdk-php
textlocal Textlocal
tsms TSMS ext-soap
twilio Twilio composer require twilio/sdk

Only the drivers you actually use have to be installed — the package itself pulls none of the gateway SDKs in.

Install

Via Composer

The service provider and the Sms facade are registered by package discovery, so there is nothing to add to config/app.php.

Configure

Publish the configuration file:

The published config/sms.php holds three things: the driver that is used when none is named, the settings of every driver and the class each driver name maps to.

Publishing is optional. The shipped configuration is merged in, so config('sms.drivers') is readable right after installation and your own config/sms.php only has to carry the keys you want to change.

How to use

Send a message

send() returns the answer of the gateway: for a single recipient the bare answer, for several of them a Collection keyed by recipient number.

Choose a driver at runtime

Change the settings of a driver at runtime

Several settings can be handed over at once:

config() overwrites the settings of the driver that is currently selected, so call it after via().

Send to several recipients at once

Use a template of the gateway

Gateways that deliver from a template of their own — Kavenegar's VerifyLookup for instance — are addressed through the message:

Drivers that do not know templates ignore them and send the plain text instead.

Notifications

The package ships a notification channel. Let via() return it and build the message in a toSms() method:

toSms() has to hand back a Shetabit\Sms\Sms instance, or null to send nothing at all.

Create custom drivers

Add the settings of your driver to the drivers array and its class to the map array of config/sms.php:

The class has to extend Shetabit\Sms\Abstracts\Driver and implement sendTo(), which delivers the message to one recipient and returns the answer of the gateway. Walking the list of recipients is the job of the abstract driver:

setting() and booleanSetting() read a single value out of the settings the driver was given.

Testing

Every pull request and every push to master is checked by GitHub Actions: the test suite runs on PHP 8.4 and 8.5, against Laravel 12 and 13 and against both the lowest and the highest supported dependencies, the coding style is checked with PHP_CodeSniffer, the sources are analysed with PHPStan and the code coverage of the test suite is measured and has to stay above 95%.

No test talks to a gateway. The driver tests answer the HTTP calls of a driver from a queue of prepared responses, and the drivers that go through an SDK of their own are given a fake of that SDK — see tests/Unit/Drivers/DriverTestCase.php and tests/Fakes/. The feature tests boot a real Laravel application with Testbench and send through a driver that records what it was asked to deliver.

You can run the same checks locally. With PHP and Composer installed on your machine:

If you would rather not install PHP on your machine, the shipped Dockerfile and Makefile run everything inside a container:

Another PHP version can be used with make test PHP_VERSION=8.5, and a single Laravel version with make test-laravel LARAVEL=12.

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of sms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-json Version *
guzzlehttp/guzzle Version ^7.9|^8.0
illuminate/contracts Version ^12.0|^13.0
illuminate/notifications Version ^12.0|^13.0
illuminate/support 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 shetabit/sms contains the following files

Loading the files please wait ...