PHPackages                             h-o-sein/kavenegar-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. [API Development](/categories/api)
4. /
5. h-o-sein/kavenegar-laravel

ActiveLaravel-package[API Development](/categories/api)

h-o-sein/kavenegar-laravel
==========================

Laravel 8 Kavenegar integration

v1.3.2(5y ago)09MITPHP

Since Nov 15Pushed 5y ago1 watchersCompare

[ Source](https://github.com/h-o-sein/kavenegar-laravel)[ Packagist](https://packagist.org/packages/h-o-sein/kavenegar-laravel)[ RSS](/packages/h-o-sein-kavenegar-laravel/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Kavenegar-Laravel
=================

[](#kavenegar-laravel)

[Kavenegar RESTful API Document](http://kavenegar.com/rest.html)
================================================================

[](#kavenegar-restful-api-document)

If you need to future information about API document Please visit RESTful Document

Installation
------------

[](#installation)

First of all, You need to make an account on Kavenegar from [Here](https://panel.kavenegar.com/Client/Membership/Register)

After that you just need to pick API-KEY up from [My Account](http://panel.kavenegar.com/Client/setting/index) section.

---

Use in these ways :

```
composer require h-o-sein/kavenegar-laravel
```

or add

```
"kavenegar/php": "*"
```

And run following command to download extension using **composer**

```
$ composer update
```

Usage
-----

[](#usage)

Well, There is an example to Send SMS by PHP.

```
require __DIR__ . '/vendor/autoload.php';

try{
	$api = new \Kavenegar\KavenegarApi( "API Key" );
	$sender = "10004346";
	$message = "خدمات پیام کوتاه کاوه نگار";
	$receptor = array("09123456789","09367891011");
	$result = $api->Send($sender,$receptor,$message);
	if($result){
		foreach($result as $r){
			echo "messageid = $r->messageid";
			echo "message = $r->message";
			echo "status = $r->status";
			echo "statustext = $r->statustext";
			echo "sender = $r->sender";
			echo "receptor = $r->receptor";
			echo "date = $r->date";
			echo "cost = $r->cost";
		}
	}
}
catch(\Kavenegar\Exceptions\ApiException $e){
	// در صورتی که خروجی وب سرویس 200 نباشد این خطا رخ می دهد
	echo $e->errorMessage();
}
catch(\Kavenegar\Exceptions\HttpException $e){
	// در زمانی که مشکلی در برقرای ارتباط با وب سرویس وجود داشته باشد این خطا رخ می دهد
	echo $e->errorMessage();
}

/*
sample output
{
    "return":
    {
        "status":200,
        "message":"تایید شد"
    },
    "entries":
    [
        {
            "messageid":8792343,
            "message":"خدمات پیام کوتاه کاوه نگار",
            "status":1,
            "statustext":"در صف ارسال",
            "sender":"10004346",
            "receptor":"09123456789",
            "date":1356619709,
            "cost":120
        },
        {
            "messageid":8792344,
            "message":"خدمات پیام کوتاه کاوه نگار",
            "status":1,
            "statustext":"در صف ارسال",
            "sender":"10004346",
            "receptor":"09367891011",
            "date":1356619709,
            "cost":120
        }
    ]
}
*/
```

Also you can use KavengarChannel for your notification:

create your notification: `php artisan make:notification InvoicePaid`

extend your notification from KavenegarBaseNotification:

```
class InvoicePaid extends KavenegarBaseNotification
{

}
```

overide the toKavengar function:

```
class InvoicePaid extends KavenegarBaseNotification
{

   public function __construct(Invoice $invoice)
   {
       $this->invoice = $invoice;
   }

    public function toKavenegar($notifiable)
    {
        return (new KavenegarMessage("فاکتور شما به شماره $invoice->id پرداخت شد."))->from('10004346');
    }
}
```

you should add Notifiable trait and routeNotificationForKavenegar method in your model

```
class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForKavenegar($driver, $notification = null)
    {
        return $this->mobile;
    }

}
```

***Notice: if you don't add routeNotificationForKavenegar in your notifiable model then you should set your receiver in your notification :***

***```
class InvoicePaid extends KavenegarBaseNotification
{

    public function toKavenegar($notifiable)
    {
        return (new KavenegarMessage('فاکتور شما به شماره ۱۲۳۴ پرداخت شد.'))->from('10004346')->to('092100000');
    }
}
```*** for send verify lookup message you should use verifyLookup method for set method name and tokens:

```
class InvoicePaid extends KavenegarBaseNotification
{

    public function toKavenegar($notifiable)
    {
        return (new KavenegarMessage())
            ->verifyLookup('verify_first',['token1','token2']);
    }
}
```

Contribution
------------

[](#contribution)

Bug fixes, docs, and enhancements welcome! Please let us know [](mailto:support@kavenegar.com?Subject=SDK)

---

راهنما
------

[](#راهنما)

### معرفی سرویس کاوه نگار

[](#معرفی-سرویس-کاوه-نگار)

کاوه نگار یک وب سرویس ارسال و دریافت پیامک و تماس صوتی است که به راحتی میتوانید از آن استفاده نمایید.

### ساخت حساب کاربری

[](#ساخت-حساب-کاربری)

اگر در وب سرویس کاوه نگار عضو نیستید میتوانید از [لینک عضویت](http://panel.kavenegar.com/client/membership/register) ثبت نام و اکانت آزمایشی برای تست API دریافت نمایید.

### مستندات

[](#مستندات)

برای مشاهده اطلاعات کامل مستندات [وب سرویس پیامک](http://kavenegar.com/%D9%88%D8%A8-%D8%B3%D8%B1%D9%88%DB%8C%D8%B3-%D9%BE%DB%8C%D8%A7%D9%85%DA%A9.html) به صفحه [مستندات وب سرویس](http://kavenegar.com/rest.html) مراجعه نمایید.

### راهنمای فارسی

[](#راهنمای-فارسی)

در صورتی که مایل هستید راهنمای فارسی کیت توسعه کاوه نگار را مطالعه کنید به صفحه [کد ارسال پیامک](http://kavenegar.com/sdk.html) مراجعه نمایید.

### اطالاعات بیشتر

[](#اطالاعات-بیشتر)

برای مطالعه بیشتر به صفحه معرفی [وب سرویس اس ام اس ](http://kavenegar.com)کاوه نگار مراجعه نمایید .

اگر در استفاده از کیت های سرویس کاوه نگار مشکلی یا پیشنهادی داشتید ما را با یک Pull Request یا ارسال ایمیل به  خوشحال کنید.

[![http://kavenegar.com](https://camo.githubusercontent.com/185be00cf5f1981bb89c349536850438c3080d325ff9575e273e00024d75b658/687474703a2f2f6b6176656e656761722e636f6d2f7075626c69632f696d616765732f6c6f676f2e706e67)](https://camo.githubusercontent.com/185be00cf5f1981bb89c349536850438c3080d325ff9575e273e00024d75b658/687474703a2f2f6b6176656e656761722e636f6d2f7075626c69632f696d616765732f6c6f676f2e706e67)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2004d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bd8b12085c4acc091a446f95d400acc96fbf2d40d8e2bc52c9bb95f3f68ab84?d=identicon)[enjoohosein](/maintainers/enjoohosein)

---

Top Contributors

[![h-o-sein](https://avatars.githubusercontent.com/u/9271127?v=4)](https://github.com/h-o-sein "h-o-sein (1 commits)")

---

Tags

apilaravelsmskavenegar

### Embed Badge

![Health badge](/badges/h-o-sein-kavenegar-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/h-o-sein-kavenegar-laravel/health.svg)](https://phpackages.com/packages/h-o-sein-kavenegar-laravel)
```

###  Alternatives

[kavenegar/laravel

laravel 4 and 5 kavenegar integration

87336.7k4](/packages/kavenegar-laravel)[kavenegar/laravel-notification

laravel notificatiion channel for Kavenegar

1338.5k1](/packages/kavenegar-laravel-notification)[multicaret/laravel-unifonic

 A library to integrate with Unifonic API to send SMS

25182.9k2](/packages/multicaret-laravel-unifonic)[melipayamak/laravel

Laravel Melipayamak Integration

2528.9k1](/packages/melipayamak-laravel)

PHPackages © 2026

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