PHPackages                             ghasedak/laravel-notification - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. ghasedak/laravel-notification

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

ghasedak/laravel-notification
=============================

Ghasedak SMS Notifications Channel for Laravel

1.0.0(5y ago)0971[2 issues](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification/issues)MITPHP

Since Oct 13Pushed 4y ago2 watchersCompare

[ Source](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification)[ Packagist](https://packagist.org/packages/ghasedak/laravel-notification)[ Docs](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification)[ RSS](/packages/ghasedak-laravel-notification/feed)WikiDiscussions master Synced yesterday

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

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

### Ghasedak Laravel Notification

[](#ghasedak-laravel-notification)

 Easy-to-use SDK for implementing Ghasedak SMS Notification 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-Notification/graphs/contributors) [![forks](https://camo.githubusercontent.com/fbe145f13347289e1a4487a84fd426e86628c8e74a14774294cfe2a731c06554/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification/network/members) [![stars](https://camo.githubusercontent.com/ac843190f969e58e565cacfeb980440579e2f899d8790f86fa0c4340ab80e16e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification/stargazers) [![issues](https://camo.githubusercontent.com/539d7c0a66a221ec4a7e5caa7554c9be1a947418281936741e136e10b377ab60/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f676861736564616b6170692f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://github.com/ghasedakapi/Ghasedak-Laravel-Notification/issues) [![license](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

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

[](#table-of-contents)

- [Install](#install)
    - [Setting up Ghasedak service](#setting-up-ghasedak-service)
    - [Add environmental variables to .env file](#add-environmental-variables-to-env-file)
- [Usage](#usage)
    - [Parameters of GhasedakSimpleSms() method](#parameters-of-ghasedaksimplesms-method)
    - [Sending Notifications](#sending-notifications)
    - [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-notification
```

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/).

### Setting up Ghasedak service

[](#setting-up-ghasedak-service)

To setup Ghasedak service properly you need an API key. To get that you should have a [Ghasedak](https://ghasedak.me) account. Register and get your API key.
Then you need to set simple configuration by adding following code to your `services.php` file.

```
// config/services.php

'ghasedak' => [
    'api_key' => env("GHASEDAK_API_KEY"),
    'linenumber' => env('LINE_NUMBER', null),
]
```

### Add environmental variables to .env file

[](#add-environmental-variables-to-env-file)

As final step of installing the package, you must add previousley defined variables to `.env` file.

```
GHASEDAK_API_KEY=your_api_key
LINE_NUMBER=your_line_number
```

Don't forget to replace `your_api_key` and `your_line_number` with actual information.

Usage
-----

[](#usage)

To use notifications in Laravel you should first create one with simple Artisan command:

```
php artisan make:notification SendSimpleNotification
```

Then you can use the channel in your `via()` method inside the notification you just created:

```
namespace App\Http\Notifications;

use Ghasedak\LaravelNotification\GhasedakChannel;
use Ghasedak\LaravelNotification\GhasedakSimpleSms;
use Illuminate\Notifications\Notification;

class SendSms extends Notification
{
    public function via($notifiable)
    {
        return [GhasedakChannel::class];
    }

    public function toSms($notifiable)
    {
        // send simple message
        return (new GhasedakSimpleSms)->message('Hello, World!')->linenumber('300xxxxx');
    }
}
```

As default `phone` field is set for receptor, but you can add `routeNotificationForSms` method to your Notifiable model to customize phone number:

```
public function routeNotificationForSms()
{
    return $this->phone;
}
```

Parameters of `GhasedakSimpleSms()` method
------------------------------------------

[](#parameters-of-ghasedaksimplesms-method)

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.string1508144471Sending Notifications
---------------------

[](#sending-notifications)

Notifications may be sent using the `notify` method of the Notifiable trait:

```
use Ghasedak\LaravelNotification\GhasedakSimpleSms;

$user->notify(new GhasedakSimpleSms());
```

Example
-------

[](#example)

Here is a sample code for `SendSimple` Notification **with support for custom parameters** instead of using a fixed template:

```
// App\Http\Notifications\SendSimpleNotification.php

namespace App\Http\Notifications;

use Ghasedak\LaravelNotification\GhasedakChannel;
use Ghasedak\LaravelNotification\GhasedakSimpleSms;
use Illuminate\Notifications\Notification;

class SendSimpleNotification extends Notification
{
    public function __construct($params)
    {
        $this->params = $params;
    }

    public function via($notifiable)
    {
        return [GhasedakChannel::class];
    }

    public function toSms($notifiable)
    {
        return (new GhasedakSimpleSms)
            ->message($this->params['message'])
            ->linenumber($this->params['linenumber'])
            ->senddate($this->params['senddate'] ?? null)
            ->checkid($this->params['checkid'] ?? null);
    }
}
```

Send notification using `notify` method:

```
$arr = array(
            'message' => 'Hello, World!', // message
            'linenumber' => '3000xxxxx', // choose a line number from your account
        );
$user->notify(new GhasedakSimpleSms($arr));
```

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).

```
$params = ['1', '2'];
$arr = array(
    'type' => 1,
    'template' => 'template',
    'params' => $params
);
$user->notify(new SendOTPNotification($arr));
```

Parameters
----------

[](#parameters)

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.string2071paramsYesArray of parameters (You must enter at least one parameter).array of stringsabcdefExample
-------

[](#example-1)

The following is a sample code for `SendOTP` Notification **with support for custom parameters** instead of using a fixed template:

```
// App\Http\Notifications\SendOTPNotification.php

namespace App\Http\Notifications;

use Ghasedak\LaravelNotification\GhasedakChannel;
use Ghasedak\LaravelNotification\GhasedakOTPSms;
use Illuminate\Notifications\Notification;

class SendOTPNotification extends Notification
{
    public function __construct($params)
    {
        $this->params = $params;
    }

    public function via($notifiable)
    {
        return [GhasedakChannel::class];
    }

    public function toSms($notifiable)
    {
        return (new GhasedakOTPSms)
            ->type($this->params['type'])
            ->template($this->params['template'])
            ->params($this->params['params']);
    }

}
```

Send notification using `notify` method:

```
$params = ['param1', 'param2', 'param3'];
$arr = array(
    'type' => 1,      // 1 for text message and 2 for voice message
    'template' => 'my-template', // name of the template which you've created in you account
    'params' => $params, // parameters (supporting up to 10 parameters)
);
$user->notify(new SendSimpleNotification($arr));
```

:)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

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

2037d ago

### Community

Maintainers

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

---

Top Contributors

[![rasoulrahimii](https://avatars.githubusercontent.com/u/24825810?v=4)](https://github.com/rasoulrahimii "rasoulrahimii (7 commits)")[![elhamesalimi](https://avatars.githubusercontent.com/u/50393647?v=4)](https://github.com/elhamesalimi "elhamesalimi (4 commits)")[![saeidmaroufi](https://avatars.githubusercontent.com/u/10104188?v=4)](https://github.com/saeidmaroufi "saeidmaroufi (1 commits)")

### Embed Badge

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

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

###  Alternatives

[tijsverkoyen/css-to-inline-styles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.

5.8k505.3M227](/packages/tijsverkoyen-css-to-inline-styles)[minishlink/web-push

Web Push library for PHP

1.9k12.0M53](/packages/minishlink-web-push)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[spatie/url-signer

Generate a url with an expiration date and signature to prevent unauthorized access

4422.3M16](/packages/spatie-url-signer)[mattketmo/email-checker

Throwaway email detection library

2742.0M5](/packages/mattketmo-email-checker)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)

PHPackages © 2026

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