Download the PHP package andrejro2/yeastar-gsm-laravel without Composer

On this page you can find all versions of the php package andrejro2/yeastar-gsm-laravel. 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 yeastar-gsm-laravel

Laravel Yeastar SMS

A Laravel package for sending SMS messages via Yeastar Gateway using the Asterisk Manager Interface (AMI) protocol. This package provides a clean, Laravel-friendly interface to interact with Yeastar GSM gateways.

Features

Requirements

Installation

You can install the package via Composer:

The package will automatically register its service provider and facade.

Publishing Configuration

Publish the configuration file to customize the package settings:

This will create a config/yeastar-sms.php file where you can configure your gateway settings.

Configuration

Environment Variables

Add the following environment variables to your .env file:

Multiple Gateway Support

You can configure multiple gateways for different environments:

AMI Configuration on Yeastar

Ensure that AMI is enabled on your Yeastar gateway:

  1. Log into your Yeastar web interface
  2. Go to Settings โ†’ System โ†’ AMI
  3. Enable AMI and configure a user with SMS sending permissions
  4. Note the port number (default is 5038)

Usage

Basic Usage with Facade

Manual Connection Configuration

Dependency Injection

Using Different Gateway Configurations

Bulk SMS Sending

Artisan Command

The package includes an example Artisan command for sending SMS from the command line:

To use this command, copy the example from examples/ArtisanCommand.php to your app/Console/Commands/ directory.

API Reference

YeastarSms Methods

setConnection(string $host, string $username, string $secret): void

Configure the gateway connection parameters.

sendSms(int $port, string $destination, string $message, ?string $id = null): bool

Send an SMS message via the gateway.

Returns true on success, throws YeastarSmsException on failure.

getConnection(): ?array

Get the current connection configuration (with secret hidden).

setTimeout(int $timeout): self

Set connection timeout in seconds (default: 30).

setReadTimeout(int $readTimeout): self

Set read timeout in seconds (default: 5).

Exception Handling

The package throws YeastarSmsException for various error conditions:

Configuration Reference

The package configuration file (config/yeastar-sms.php) includes:

Testing

Run the package tests:

Run tests with coverage:

Troubleshooting

Common Issues

  1. Connection Failed

    • Verify gateway hostname and port
    • Check network connectivity
    • Ensure firewall allows connection to AMI port (default 5038)
  2. Authentication Failed

    • Verify username and secret
    • Check if AMI is enabled on the gateway
    • Ensure user has proper permissions
  3. SMS Command Failed

    • Check if GSM module is properly configured
    • Verify SIM card balance and network registration
    • Ensure correct port number
  4. Timeout Errors
    • Increase timeout values in configuration
    • Check network latency
    • Verify gateway is responsive

Debugging

Enable logging to see detailed information about SMS sending:

This will log connection attempts, authentication, and SMS sending details.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details.

Security Vulnerabilities

If you discover a security vulnerability, please send an e-mail to the package maintainer. All security vulnerabilities will be promptly addressed.

Credits

This package is based on the Go implementation at yeastartgsms.

License

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

Changelog

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


Related Projects

Support


Made with โค๏ธ for the Laravel community


All versions of yeastar-gsm-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.3
illuminate/support Version ^9.0|^10.0|^11.0|^12.0
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.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 andrejro2/yeastar-gsm-laravel contains the following files

Loading the files please wait ....