Download the PHP package calisero/laravel-sms without Composer

On this page you can find all versions of the php package calisero/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 Package for Calisero

Latest Version on Packagist tests PHPStan License Tests Total Downloads

A first-class Laravel package that wraps the Calisero PHP SDK and provides idiomatic Laravel features for sending SMS messages through the Calisero API. Supports Laravel 12 and Laravel 13.

Features

Internal package logging was removed. Add your own logging in event listeners/subscribers.

Requirements

Package version Laravel PHP
^1.2 12.x, 13.x 8.2 – 8.5 (Laravel 13 requires PHP 8.3+)
1.0.x – 1.1.x 12.x 8.2 – 8.4

Composer picks the right Laravel release for your PHP version automatically: on PHP 8.2 you get Laravel 12, and on PHP 8.3, 8.4 or 8.5 you can run either Laravel 12 or 13.

Installation

You can install the package via Composer:

Publish the configuration file

Configure your environment

Add your Calisero API credentials to your .env file:

Usage

Quick Start

Sending SMS via Facade

Verification Codes (2FA)

Send and verify one-time codes for two-factor authentication:

Note: Either brand OR template is required when sending verification codes. The template must contain {code} placeholder. Codes are 6 characters and sent via SMS.

Using Notifications

Create a notification class:

Send the notification:

For the notification to work, your User model should implement the routeNotificationForCalisero method:

Using the Direct Client

For more control, inject the client directly:

Validation Rules

Use the included validation rules in your form requests:

Webhook Handling

Enable webhooks by setting CALISERO_WEBHOOK_ENABLED=true. The package will register a POST endpoint at /calisero/webhook (or your configured CALISERO_WEBHOOK_PATH).

Securing the Webhook (Query Token)

If you also set CALISERO_WEBHOOK_TOKEN=your-shared-secret, the package will:

Requirements when token security is enabled:

Environment example:

Example of explicit override (token already present, no modification by the library):

Rotation tip: rotate the token by

  1. Adding a temporary second endpoint (optional) or a maintenance window.
  2. Updating CALISERO_WEBHOOK_TOKEN.
  3. Redeploying and updating the callback URL in Calisero (or sending a new message to propagate the injected URL).

If you leave CALISERO_WEBHOOK_TOKEN empty, no token middleware is attached and the endpoint is publicly accessible (POST only). Consider other controls (IP allow-list, WAF) if you opt out of the token.

Listen for the events:

Statuses currently emitted (lifecycle):

Webhook payload example (flat structure):

When the same message is later delivered you will receive another webhook with:

A failed attempt would have "status": "failed" and usually a deliveredAt of null.

Automatic callback_url Injection

If CALISERO_WEBHOOK_ENABLED=true, every sendSms() call without an explicit callback_url (or callbackUrl) automatically includes one pointing to the named route calisero.webhook (if registered) or a URL built from app.url + the configured path.
To override, supply your own callback_url parameter.
To disable injection, set CALISERO_WEBHOOK_ENABLED=false or omit the env variable.

Edge cases:

Example (override):

Artisan Commands

The package provides several Artisan commands for testing and development:

Test SMS Sending

SMS Status

Verification Commands

Send a verification code with brand:

Send a verification code with custom template:

Check a verification code:

Webhook Verification

Verify webhook signatures offline:

Environment Variables Reference

Variable Required Default Description
CALISERO_API_KEY Yes - Your Calisero API key from the dashboard
CALISERO_BASE_URI No https://rest.calisero.ro/api/v1 Calisero API base URL
CALISERO_ACCOUNT_ID No - Your account ID for balance queries
CALISERO_TIMEOUT No 10.0 Request timeout in seconds
CALISERO_CONNECT_TIMEOUT No 3.0 Connection timeout in seconds
CALISERO_RETRIES No 5 Number of retry attempts
CALISERO_RETRY_BACKOFF_MS No 200 Backoff delay between retries (ms)
CALISERO_WEBHOOK_ENABLED No false Enable webhook handling
CALISERO_WEBHOOK_PATH No calisero/webhook Webhook endpoint path
CALISERO_WEBHOOK_TOKEN No - Shared secret for webhook authentication
CALISERO_CREDIT_LOW No - Credit threshold for low balance alerts
CALISERO_CREDIT_CRITICAL No - Credit threshold for critical balance alerts
CALISERO_LOG_CHANNEL No default Laravel log channel to use

Advanced Configuration

The configuration file (config/calisero.php) allows you to customize:

Sender ID (Alphanumeric) Requirements

Custom alphanumeric sender IDs (the from field) must be pre‑approved by Calisero before they can be used in production traffic. If you send a message with an unapproved sender:

Approval Guidelines:

How to Request Approval:

  1. Log in to your Calisero dashboard (https) and navigate to Sender IDs
  2. Submit each desired sender (case‑sensitive) with a brief business justification.
  3. Wait for confirmation before deploying to production.

Best Practices:

Example (with fallback logic):

NOTE: If you do not have an approved sender yet, omit from to let Calisero assign a default.

Credit Monitoring & Balance Alerts

Configure optional balance thresholds to emit events when your Calisero account credit becomes low or critical:

Environment variables:

Events:

Example listener registration:

If a critical threshold is met, only CreditCritical is fired (not CreditLow). Leave variables unset (or null) to disable.

Examples

A curated set of runnable usage examples lives in the examples/ directory:

Scenario File
Send an SMS via Facade examples/send_sms_facade.php
Send notification examples/notification_example.php
Register webhook & delivery listeners examples/webhook_listeners.php
Credit monitoring listeners examples/credit_monitoring_listeners.php
Event subscriber pattern examples/event_subscriber.php
Config customization snippet examples/custom_config_snippet.php

Quick peek (webhook event handling):

See the Examples README for setup & detailed walkthroughs.

Error Handling

The package provides comprehensive error handling:

Testing

Basic test run:

Quality Assurance (CI / Local)

The project ships with an automated GitHub Actions workflow (.github/workflows/ci.yml) that runs:

Local commands:

To test against a specific Laravel version locally:

Notes:

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

Links

Calisero Laravel library allows you to send SMSs from your Laravel application using Calisero API


All versions of laravel-sms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2 || ^8.3 || ^8.4 || ^8.5
illuminate/support Version ^12.0 || ^13.0
illuminate/notifications Version ^12.0 || ^13.0
illuminate/validation Version ^12.0 || ^13.0
illuminate/routing Version ^12.0 || ^13.0
illuminate/console Version ^12.0 || ^13.0
calisero/calisero-php Version ^2.3
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 calisero/laravel-sms contains the following files

Loading the files please wait ...