Download the PHP package mahdi-hejazi/laravel-ghasedak-sms without Composer

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

Laravel Ghasedak SMS

Modern Laravel package for Ghasedak SMS API with template and simple SMS support.

packagist url: https://packagist.org/packages/mahdi-hejazi/laravel-ghasedak-sms

Features

Installation

Requirements

Install via Composer

Publish Configuration

Configuration

Add your Ghasedak credentials to your .env file:

Usage

OTP SMS Usage Examples

New OTP API Features

The new OTP API endpoint supports:

Basic Usage

0. Add template to Laravel Config

1. Single OTP with Named Parameters

2. Using Notification Classes

3. Advanced Features

Scheduled OTP

Voice OTP

Custom Client Reference ID

Template Configuration (old version of OTP)

1. Create Templates in Ghasedak Panel

Create templates at ghasedak.me with named parameters:

Example Templates:

2. Add to Laravel Config

Response Format

The new OTP API returns detailed response:

Error Handling

Migration from Old API

Before (Old Template API):

After (New OTP API):

Best Practices

  1. Use meaningful client reference IDs for tracking
  2. Test templates in Ghasedak panel before using in code
  3. Handle errors gracefully with try-catch blocks
  4. Monitor costs using the totalCost field in responses
  5. Use bulk methods for multiple recipients to reduce API calls
  6. Clean parameter values - avoid special characters
  7. Use scheduled sending for time-sensitive messages

Available Factory Methods

Adding Custom Factory Methods

You can extend the notification classes to add your own factory methods:

Method 1: Extend the Notification Class

Usage:

Method 2: Create Your Own Notification Service

Usage:

Method 3: Using Macros (Advanced)

Add to your AppServiceProvider.php:

Usage:

Template Requirements

When adding custom templates, remember:

  1. Create in Ghasedak Panel: First create your template at ghasedak.me
  2. Add to Config: Add template mapping to config/ghasedak.php
  3. Parameter Limit: Maximum 10
  4. parameters (%param1%, %param2%, ... %param10%)

Example Custom Template Setup:

  1. In Ghasedak Panel:

  2. In config/ghasedak.php:

  3. In Your Code:

Queue Support

Both notifications support Laravel queues:

Error Handling

Configuration

Prerequisites

⚠️ Important: Before using template-based SMS, you must:

  1. Create templates in Ghasedak panel at ghasedak.me
  2. Go to SMS Panel > Templates > Create Template
  3. Create your template with parameters like %param1%, %param2%, %param3%, ... %param10%
  4. Get the template name from your panel
  5. Add template name to your config

Templates

Define your SMS templates in config/ghasedak.php:

Example Ghasedak Template:

Step-by-Step Template Setup

1. Create Template in Ghasedak Panel

  1. Visit ghasedak.me and login
  2. Go to SMS Panel > Templates
  3. Click Create New Template
  4. Fill template details:
    • Template Name: verifyCodeTemplate
    • Template Text: کد تایید شما: %param1% - این کد 5 دقیقه معتبر است
    • Category: Select appropriate category
  5. Submit and wait for approval

2. Add to Laravel Config

3. Use in Code

Advanced Examples

Advanced Examples

E-commerce Notifications

Medical Center Notifications

Bulk SMS Service

Logging

Control SMS logging:

Testing

Mock Tests (Free - No API Key Required)

Real API Tests (Costs Money - Sends Real SMS)

  1. Set your real API credentials

    Edit tests/.env with your GHASEDAK_API_KEY and template name

  2. Run real API tests

Note: Mock tests use fake responses and don't send real SMS. Integration tests send actual SMS and will cost money.

API Updates

This package uses the latest Ghasedak REST API (v1) with:

Contributing

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.


All versions of laravel-ghasedak-sms with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1|^8.2|^8.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 mahdi-hejazi/laravel-ghasedak-sms contains the following files

Loading the files please wait ...