Download the PHP package codepagol/sms-bridge without Composer

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

SmsBridge: Unified Bangladeshi SMS Gateway for Laravel 🇧🇩

A simple, unified Laravel SMS package to seamlessly connect with multiple Bangladeshi SMS Gateways (like AdnSms, ElitBuzz, AlphaSms) using a single .env configuration structure. No more confusing or duplicated environment variables when you need to switch SMS providers!

🔥 The Ultimate Smart Auto-Failover System

Never lose a critical SMS (OTP, Alerts) again! If you add multiple gateways to your system (e.g., AdnSms, Infobip, SSL Wireless), SmsBridge will automatically try them one by one based on your set priorities. If your primary gateway API is down, out of balance, or times out, the system will instantly reroute and send the SMS automatically through the next active gateway behind the scenes! No complicated try-catch loops required.

Key Features


Installation

  1. Add the package to your composer.json (if testing locally without Packagist yet):

  2. Require the package via Composer:

  3. Publish the configuration file:

Configuration (Database & UI Based - No .env required for credentials)

We've removed the necessity to use .env files for adding credentials! The package now features a fully-fledged Admin Panel that stores gateway information securely inside your Database.

  1. Publish the views, database migrations, and configuration to your project:

    (Or run them individually via --tag="sms-bridge-config" and --tag="sms-bridge-views")

  2. Crucial: Run the database migrations to create the sms_gateways table:

  3. Log into your main Laravel application.
  4. Visit the secured gateway UI at: your-app.test/sms-bridge
  5. Add your gateways (Infobip, AlphaSms, Elitbuzz etc) via the graphic interface. You can set the priority for fallback!

Multi-Gateway Activation & Failover Logic

The true power of SmsBridge lies in its native Smart Failover System. You do not have to rely on a single SMS provider!

  1. Enable Multiple Gateways (The Checkbox System): In the Admin UI, you will see an Active checkbox switch for each gateway. You can enable as many gateways as you want simultaneously. Only gateways that are checked as Active will participate in the SMS sending process.

  2. Priority Ordering: When adding or editing a gateway, you can set a Priority number (e.g., 1, 2, 3) and mark one as Default.

    • The Default gateway is always prioritized first.
    • The rest of the Active gateways are sorted by their priority numbers.
  3. How the Failover Works: When you send an SMS using Codepagol\SmsBridge\Services\SmsBridgeService::sendSms(), the system does the following:
    • It attempts to send the SMS using the first active gateway (the Default or highest priority one).
    • If that gateway fails (e.g., due to an invalid API key, insufficient balance, API downtime, or timeout), the system automatically catches the error.
    • It immediately falls back and tries to send the SMS using the next active gateway in your priority list.
    • This process continues until the SMS is successfully delivered or all active gateways have failed.

This guarantees maximum delivery rates for your OTPs and critical messages without writing complicated try-catch loops yourself!


Usage

Using the Facade (Recommended)

You can send SMS from any Controller, Job, or Service by importing the SmsBridge facade:

Background Queue Support

If you want to dispatch SMS via Laravel's Queue system to keep your application fast, use the queue() method instead of send():

Note: Make sure your QUEUE_CONNECTION in .env is configured properly (e.g., database, redis) and you are running php artisan queue:work.

Advanced API Endpoints

You can fetch Account Balance and Profile details from supported Gateways natively:

In the Admin UI, you can specify modular endpoints for these requests:

Dependency Injection

Or, inject the underlying manager dynamically:


Supported Gateways

Currently supported SMS_BRIDGE_GATEWAY strings:

Auto-Log & Testing Integration

SmsBridge includes a built-in log gateway designed specifically for local testing to stop you from wasting real SMS credits. It comes with some incredibly smart defaults:

  1. Implicit Fallback (Zero Config): If you install the package and do not configure any active gateways in the admin panel, SmsBridge will automatically fall back to the log gateway. All your dispatched SMS messages will safely write to storage/logs/laravel.log without crashing!
  2. Mutual Exclusivity: If you explicitly enable the log gateway from the admin UI, the system will automatically disable all your other real gateways. Conversely, if you enable a real gateway (e.g., Banglalink, SSL Wireless, etc.), the system automatically disables the log gateway.

This ensures you never accidentally send real SMS while debugging, or vice versa!

Run Automated Tests

License

This package is open-sourced software licensed under the MIT license.


All versions of sms-bridge with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
illuminate/support Version >=8.0
illuminate/database Version >=8.0
illuminate/routing Version >=8.0
guzzlehttp/guzzle Version ^7.2
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 codepagol/sms-bridge contains the following files

Loading the files please wait ...