Download the PHP package fardadev/kavenegar-for-laravel without Composer

On this page you can find all versions of the php package fardadev/kavenegar-for-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 kavenegar-for-laravel

Kavenegar Laravel Package

Latest Version on Packagist Total Downloads

Modern Laravel 11+ package for Kavenegar SMS API integration with full type safety, comprehensive testing, and Laravel best practices.

Features

Requirements

Installation

Install the package via Composer:

The package will automatically register itself thanks to Laravel's auto-discovery feature.

Publish Configuration

Publish the configuration file:

This will create a config/kavenegar.php file in your application.

Environment Variables

Add your Kavenegar credentials to your .env file:

Configuration

The config/kavenegar.php file contains all package configuration options:

Configuration Options

Option Type Default Description
api_key string - Your Kavenegar API key (required)
sender string|null null Default sender line number
timeout int 30 HTTP request timeout in seconds
skip_in_development bool true Skip SMS in local/dev environments
test_phone_numbers array [] Phone numbers treated as test numbers
templates array [] Template names for verification codes

Usage

Basic SMS Sending

Using Facade

Using Dependency Injection

Bulk SMS Sending

Send different messages to different recipients from different senders:

Verification Codes

Using verifyLookup

Using Helper Methods

The package includes a KavenegarHelper class with convenient methods for common verification scenarios. This helper automatically handles development environment skipping and token normalization.

Note: The KavenegarHelper is a convenience implementation for common use cases. You can create your own custom helper class by injecting KavenegarClient and implementing logic specific to your application's needs.

Checking Message Status

Message History and Selection

Cancelling Messages

Voice Calls (TTS)

Account Information

Advanced Features

Creating Custom Helpers

While the package includes KavenegarHelper for common scenarios, you can create your own custom helper tailored to your application's specific needs:

Then use it in your application:

Exception Handling

The package throws specific exceptions for different error scenarios:

Environment-Based Testing

The package can skip SMS sending in development/testing environments:

Privacy Features

Hide receptor numbers in logs and console:

Duplicate Prevention

Use local IDs to prevent duplicate sends:

Message Tagging

Organize messages with tags:

Custom Sending Policies

Use custom sending flows (if configured in panel):

Data Transfer Objects (DTOs)

All responses are strongly-typed readonly objects:

Error Codes

Common error codes you might encounter:

Code Description Exception Type
200 Success -
400 Incomplete parameters ValidationException
401 Invalid API key ApiException
402 Operation failed ApiException
407 Access denied (IP restriction) ApiException
411 Invalid receptor number ValidationException
412 Invalid sender number ValidationException
413 Message too long or empty ValidationException
414 Too many records ValidationException
418 Insufficient credit ApiException
419 Array length mismatch ValidationException

See docs/error-codes.md for complete error code reference.

API Documentation

For detailed API documentation, see:

Testing

Static Analysis

Code Formatting

Changelog

Please see CHANGELOG for recent changes.

Contributing

Contributions are welcome! Please see CONTRIBUTING 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.

Support


All versions of kavenegar-for-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^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 fardadev/kavenegar-for-laravel contains the following files

Loading the files please wait ...