PHPackages                             ghasedak/laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ghasedak/laravel

ActiveLibrary

ghasedak/laravel
================

Easy-to-use SDK for implementing Ghasedak SMS API in your Laravel projects.

v2.1.3(3y ago)2120.4k↓40%3[1 PRs](https://github.com/ghasedakapi/ghasedak-laravel/pulls)1MITPHP

Since Oct 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ghasedakapi/ghasedak-laravel)[ Packagist](https://packagist.org/packages/ghasedak/laravel)[ RSS](/packages/ghasedak-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (16)Used By (1)

 [ ![Logo](ghasedak-logo.png) ](https://github.com/ghasedakapi/laravel)

### Ghasedak Laravel SDK

[](#ghasedak-laravel-sdk)

 Easy-to-use SDK for implementing Ghasedak SMS API in your Laravel projects.
 [**Explore the docs »**](#table-of-contents)

 [Web Service Documents](https://ghasedak.me/developers) · [REST API](https://ghasedak.me/docs) . [Report Bug](https://github.com/ghasedakapi/ghasedak-php/issues) · [Request Feature](https://github.com/ghasedakapi/ghasedak-php/issues)

 [![contributors](https://camo.githubusercontent.com/6168f6f5754e68d2c9f264e59ec5c86fbcee7a38a62115305748209d948314e7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/ghasedak-laravel/graphs/contributors) [![forks](https://camo.githubusercontent.com/fbe145f13347289e1a4487a84fd426e86628c8e74a14774294cfe2a731c06554/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/ghasedak-laravel/network/members) [![stars](https://camo.githubusercontent.com/ac843190f969e58e565cacfeb980440579e2f899d8790f86fa0c4340ab80e16e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/ghasedak-laravel/stargazers) [![issues](https://camo.githubusercontent.com/539d7c0a66a221ec4a7e5caa7554c9be1a947418281936741e136e10b377ab60/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/ghasedak-laravel/issues) [![license](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

 [English Document](#table-of-contents) | [مستندات فارسی](#table-of-contents-fa)

Table of Contents
-----------------

[](#table-of-contents)

- [Install](#install)
- [Update](#update)
- [Usage](#usage)
    - [Parameters](#parameters)
    - [Example](#example)
- [One-Time Passwords (OTP)](#one-time-passwords-otp)
    - [Parameters](#parameters-1)
    - [Example](#example-1)
- [Licence](#license)

Install
-------

[](#install)

The easiest way to install is by using Composer:

```
composer require ghasedak/laravel
```

Composer is a dependency manager for PHP which allows you to declare the libraries your project depends on, and it will manage (install/update) them for you. If you are not familiar with Composer, you can read its documentations and download it via [getcomposer.org](https://getcomposer.org/).

Update
------

[](#update)

Set this line to Composer.json file in your project:

```
"ghasedak/laravel": "*"

```

Then run following command to update using composer

```
composer update
```

Composer update the required packages on your local machine.

usage
-----

[](#usage)

To use the package, you need an API key. To get that you should have a [Ghasedak](https://ghasedak.me) account. Register and get your API key.
Copy the following variable into your project's `.env` file and change `your_api_key` to the key you have got from your Ghasedak account.

```
GHASEDAKAPI_KEY=your_api_key
```

Use `GhasedakFacade` on top of your controller or wherever you want:

```
use Ghasedak\Laravel\GhasedakFacade;
```

then you can use `GhasedakApi` methods statically, to use ` SendSimple`

```
$response = GhasedakFacade::SendSimple($receptor, $message, $lineNumber = null, $sendDate = null, $checkId = null);
```

\####OR

```
$response = Ghasedak\Laravel\GhasedakFacade::SendSimple($receptor, $message, $lineNumber = null, $sendDate = null, $checkId = null);
```

Parameters
----------

[](#parameters)

ParameterRequiredDescriptionTypeExamplemessageYesText to be sentstringHello, World!receptorYesThe number of the recipient(s) of the message (seperated by comma `,`).string09111111111linenumberNoThe number of the sender of the message, which, if not specified, will be selected from your dedicated lines with a higher priority.**`(If you do not have a dedicated line, you must specify the linenumber)`**string5000222senddateNoThe exact date and time of sending the message based on Unix time, if not specified, the message will be sent instantly.string1508144471Example
-------

[](#example)

Here is a sample code for sending SMS. Please note that you must specify `line number` if you don't have a dedicated line.

```
$receptor = '09xxxxxxxxx';
$message = 'Hello, World!';
$lineNumber = '3000xxxxx';

$response = Ghasedak\Laravel\GhasedakFacade::SendSimple($receptor, $message, $lineNumber);
```

One-Time Passwords (OTP)
------------------------

[](#one-time-passwords-otp)

The One-Time-Password (OTP) Interface is used to perform a mobile authentication or to implement Two-Factor-Authentication (2FA).
You can pass up to 10 `param` to `Verify` method:

```
$response = Ghasedak\Laravel\GhasedakFacade::setVerifyType(Ghasedak\Laravel\GhasedakFacade::VERIFY_MESSAGE_TEXT)
->Verify(
    "09xxxxxxxxx",  // receptor
    "my-template",  // name of the template which you've created in you account
    "param1",       // parameters (supporting up to 10 parameters)
    "param2",
    "param3"
);
```

Parameters
----------

[](#parameters-1)

ParameterRequiredDescriptionTypeExamplereceptorYesThe number of the recipient of the message.string09111111111typeYesSet `1` to send text message and `2` to send voice message.intHello, World!templateYesThe title of the template you created in your panel.stringmy-templatecheckidNoIt is used to set a unique number for each SMS, and after sending the SMS, all the information of the sent message can be received with the `status` method.string2071param1YesThe values you enter (You must enter at least one parameter).stringabcdefparam2NoThe values you enter.stringabcdefparam3NoThe values you enter.stringabcdefparam4NoThe values you enter.stringabcdefparam5NoThe values you enter.stringabcdefparam6NoThe values you enter.stringabcdefparam7NoThe values you enter.stringabcdefparam8NoThe values you enter.stringabcdefparam9NoThe values you enter.stringabcdefparam10NoThe values you enter.stringabcdefExample
-------

[](#example-1)

```
$receptor = "09xxxxxxxxx";
$type = Ghasedak\Laravel\GhasedakFacade::VERIFY_MESSAGE_TEXT;
$template = "my-template";
$param1 = '123456';

$response = Ghasedak\Laravel\GhasedakFacade::setVerifyType($type)->Verify($receptor, $template, $param1);
```

:)

License
-------

[](#license)

Freely distributable under the terms of the [MIT](https://opensource.org/licenses/MIT) license.

فهرست مطالب
------------

[](#فهرست-مطالب-)

- [نصب](#install-fa)
- [به روزرسانی](#update-fa)
- [استفاده](#usage-fa)
- [پارامترها](#parameters-fa)
- [نمونه کد](#example-fa)

- [رمز عبور یک‌بار مصرف](#otp-fa)
- [پارامترها](#parameters1-fa)
- [نمونه کد](#example1-fa)

- [مجوز](#licence-fa)

نصب
---

[](#نصب)

ساده‌ترین راه برای نصب این پکیج استفاده از Composer است:

```
composer require ghasedak/laravel
```

[Composer](https://getcomposer.org/) سامانه‌ای برای مدیریت بسته‌های زبان PHP است که به شما امکان مدیریت (نصب / به روزرسانی) پکیج‌های نوشته شده در این زبان را می‌دهد. اگر با کامپوزر آشنایی ندارید، می‌توانید از طریق سایت [getcomposer.org](https://getcomposer.org/) مستندات آن را مطالعه و اقدام به بارگیری و نصب آن کنید.

به روزرسانی
-----------

[](#به-روزرسانی)

خط زیر را در فایل composer.json به صورت زیر تغییر دهید :

```
"ghasedak/laravel": "*"
```

سپس خط فرمان زیر را اجرا نمایید :

```
composer update
```

 کامپوزر با اجرای این خط فرمان پکیج و نیازمندی های آن را در برنامه شما به روزرسانی خواهد کرد.

 نحوه استفاده
--------------

[](#-نحوه-استفاده-)

برای استفاده از این پکیج می‌بایست API key داشته باشید. جهت دریافت ابتدا در [سایت قاصدک](https://ghasedak.me/) ثبت‌نام کنید و از پنل کاربری‌تان API key دریافت کنید.

متغیر زیر را درون فایل `.env` پروژه‌ی خود کپی کرده و به جای `your_api_key` کلید دریافتی از حساب قاصدک خود را قرار دهید.

```
GHASEDAKAPI_KEY=your_api_key
```

در بالای کنترلر یا هر جایی از پروژه `GhasedakApi` را استفاده کنید:

```
use Ghasedak\Laravel\GhasedakFacade;
```

سپس شما میتوانید از متد های `GhasedakApi` به صورت استاتیک استفاده کنید برای استفاده از `SendSimple`

```
$response = GhasedakFacade::SendSimple($receptor, $message, $lineNumber = null, $sendDate = null, $checkId = null);
```

\####یا

```
$response = Ghasedak\Laravel\GhasedakFacade::SendSimple($receptor, $message, $lineNumber = null, $sendDate = null, $checkId = null);
```

:))

پارامترها
---------

[](#پارامترها)

   پارامتر اجباری توضیحات نوع مثال     message بله متنی که باید ارسال شود. string سلام دنیا!   receptor بله شماره گیرنده پیام می باشد. string 09111111111   linenumber خیر شماره فرستنده پیام می باشد، که اگر قید نشود از بین خطوط اختصاصی شما خط با اولویت بالاتر انتخاب می شود.**`( در صورت نداشتن خط اختصاصی باید linenumber را مشخص نمایید )`** string 5000222   senddate خیر تاریخ و زمان دقیق ارسال پیام بر اساس Unixtime می باشد که اگر قید نشود در همان لحظه پیام ارسال می شود. string 1508144471   checkid خیر برای تعیین شماره ای یکتا از طرف کاربر برای هر پیامک به کار می رود و پس از ارسال پیامک می توان با متد `status` کلیه اطلاعات پیام ارسال شده را دریافت کرد. string 2071

نمونه کد
--------

[](#نمونه-کد)

 کد زیر نمونه‌ای از متد ارسال تکی پیامک می‌باشد. لطفا توجه کنید که در صورت نداشتن خط اختصاصی می‌بایست حتما `line number` را وارد کنید.

```
$receptor = '09xxxxxxxxx';
$message = 'Hello, World!';
$lineNumber = '3000xxxxx';

$response = Ghasedak\Laravel\GhasedakFacade::SendSimple($receptor, $message, $lineNumber);
```

 رمز عبور یکبار مصرف (OTP)
---------------------------

[](#-رمز-عبور-یکبار-مصرف-otp--)

 رمز عبور یک‌بار مصرف برای اعتبارسنجی از طریق تلفن همراه و یا برای ورود دو مرحله‌ای (2FA) استفاده می‌شود.

با استفاده از متد `Verify` می‌توانید تا سقف 10 `param` را ارسال کنید:

```
$response = Ghasedak\Laravel\GhasedakFacade::setVerifyType(Ghasedak\Laravel\GhasedakFacade::VERIFY_MESSAGE_TEXT)
->Verify(
    "09xxxxxxxxx", // receptor
    "my-template", // name of the template which you've created in you account
    "param1",      // parameters (supporting up to 10 parameters)
    "param2",
    "param3"
);
```

پارامترها
---------

[](#پارامترها-1)

   پارامتر اجباری توضیحات نوع مثال     receptor بله شماره گیرنده پیام که با ( , ) از هم جدا می شوند. string 09111111111   type بله برای ارسال پیام متنی عدد `1` و برای ارسال پیام صوتی عدد `2` را وارد کنید. int Hello, World!   template بله عنوان قالبی که در پنل خود ایجاد کرده اید. string my-template   checkid خیر برای تعیین شماره ای یکتا از طرف کاربر برای هر پیامک به کار می رود و پس از ارسال پیامک می توان با متد `status` کلیه اطلاعات پیام ارسال شده را دریافت کرد string 2071   param1 بله مقادیری که از سمت شما وارد می شود (وارد کردن حداقل 1 مورد اجباری است). string abcdef   param2 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param3 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param4 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param5 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param6 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param7 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param8 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param9 خیر مقادیری که از سمت شما وارد می شود. string abcdef   param10 خیر مقادیری که از سمت شما وارد می شود. string abcdef

نمونه کد
--------

[](#نمونه-کد-1)

```
$receptor = "09xxxxxxxxx";
$type = Ghasedak\Laravel\GhasedakFacade::VERIFY_MESSAGE_TEXT;
$template = "my-template";
$param1 = '123456';

$response = Ghasedak\Laravel\GhasedakFacade::setVerifyType($type)->Verify($receptor, $template, $param1);
```

مجوز
----

[](#مجوز)

این پکیج تحت مجوز [MIT](https://opensource.org/licenses/MIT) منتشر شده است.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 68% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~54 days

Recently: every ~3 days

Total

14

Last Release

1338d ago

Major Versions

1.0.9 → V2.0.12022-09-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/c32532a4b54b97d8672cdfb01b0bbd358dbb6321ffc0f8b82d08b1a755864fe4?d=identicon)[ahoseinpour](/maintainers/ahoseinpour)

---

Top Contributors

[![hopeofiran](https://avatars.githubusercontent.com/u/91685701?v=4)](https://github.com/hopeofiran "hopeofiran (17 commits)")[![elhamesalimi](https://avatars.githubusercontent.com/u/50393647?v=4)](https://github.com/elhamesalimi "elhamesalimi (3 commits)")[![rasoulrahimii](https://avatars.githubusercontent.com/u/24825810?v=4)](https://github.com/rasoulrahimii "rasoulrahimii (3 commits)")[![ahoseinpour](https://avatars.githubusercontent.com/u/31063471?v=4)](https://github.com/ahoseinpour "ahoseinpour (1 commits)")[![saeidmaroufi](https://avatars.githubusercontent.com/u/10104188?v=4)](https://github.com/saeidmaroufi "saeidmaroufi (1 commits)")

### Embed Badge

![Health badge](/badges/ghasedak-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ghasedak-laravel/health.svg)](https://phpackages.com/packages/ghasedak-laravel)
```

###  Alternatives

[tartan/laravel-iranian-sms

Laravel 5.x sms handler for working with most iranian sms operators

255.3k](/packages/tartan-laravel-iranian-sms)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
