PHPackages                             bahricanli/netgsm - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. bahricanli/netgsm

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bahricanli/netgsm
=================

Sends SMS using Netgsm API

1.0.2(3y ago)042MITPHPPHP &gt;=7

Since Apr 4Pushed 3y agoCompare

[ Source](https://github.com/bahricanli/netgsm)[ Packagist](https://packagist.org/packages/bahricanli/netgsm)[ Docs](https://github.com/bahricanli/netgsm)[ RSS](/packages/bahricanli-netgsm/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Netgsm Notification Channel For Laravel 5.3
===========================================

[](#netgsm-notification-channel-for-laravel-53)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d5124626bb0fd5273c9946f228f1f77bb4d4de28f1d17c116a0a7247305cf8b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626168726963616e6c692f4e657467736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bahricanli/Netgsm)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/2fee0a1176e86a1910db6f7b86e27c62cebbf05d22e51a5c0c0dfea13476d611/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f626168726963616e6c692f4e657467736d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/bahricanli/Netgsm)[![StyleCI](https://camo.githubusercontent.com/004449f174d6b465107722501a64b016bf344acd1375755c8783abb2970dd179/68747470733a2f2f7374796c6563692e696f2f7265706f732f37343330343434302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/74304440)[![SensioLabsInsight](https://camo.githubusercontent.com/bef168221ab5500f46f92c310be26ff5d9b6630c440da2766cacc59ea3024983/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f63653566313131662d316265342d343834382d613837642d3762323537306431353364342e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/ce5f111f-1be4-4848-a87d-7b2570d153d4)[![Quality Score](https://camo.githubusercontent.com/02215d5285309c267f26bc96b828ec733db974820ee66a441e572ca12d45e0bd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f626168726963616e6c692f4e657467736d2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bahricanli/Netgsm)[![Code Coverage](https://camo.githubusercontent.com/7bb2f36cde5421ea3dd2a979998ca6df2793d56bb604fd07bf9593cf1f66a527/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f626168726963616e6c692f4e657467736d2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/bahricanli/Netgsm/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/f51e1071f3eab30deefe8e8eb5859d6408ff8d4877031f587853e681c63b99c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626168726963616e6c692f4e657467736d2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bahricanli/Netgsm)

This package makes it easy to send notifications using [Netgsm](http://www.Netgsm.com) with Laravel 5.3.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Netgsm service](#setting-up-the-Netgsm-service)
- [Usage](#usage)
    - [Available methods](#available-methods)
    - [Available events](#available-events)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

You can install this package via composer:

```
composer require bahricanli/Netgsm
```

Next add the service provider to your `config/app.php`:

```
/*
 * Package Service Providers...
 */

NotificationChannels\Netgsm\NetgsmServiceProvider::class,
```

Register the Netgsm alias to your application. This registration is not optional because the channel itself uses this very alias.

```
'Netgsm' => NotificationChannels\Netgsm\Netgsm::class,
```

### Setting up the Netgsm service

[](#setting-up-the-netgsm-service)

Add your desired client, username, password, originator (outbox name, sender name) and request timeout configuration to your `config/services.php` file:

```
...
    'Netgsm' => [
        'client'     => 'http', // or xml
        'http'       => [
            'endpoint' => 'https://service.jetsms.com.tr/SMS-Web/HttpSmsSend',
        ],
        'xml'        => [
            'endpoint' => 'www.biotekno.biz:8080/SMS-Web/xmlsms',
        ],
        'username'   => '',
        'password'   => '',
        'originator' => "", // Sender name.
        'timeout'    => 60,
    ],
...
```

Usage
-----

[](#usage)

Now you can use the channel in your via() method inside the notification:

```
use NotificationChannels\Netgsm\NetgsmChannel;
use NotificationChannels\Netgsm\NetgsmMessage;

class ResetPasswordWasRequested extends Notification
{
    /**
     * Get the notification's delivery channels.
     *
     * @param  mixed  $notifiable
     * @return array
     */
    public function via($notifiable)
    {
        return [NetgsmChannel::class];
    }

    /**
     * Get the Netgsm representation of the notification.
     *
     * @param  mixed  $notifiable
     * @return string|\NotificationChannels\Netgsm\NetgsmMessage
     */
    public function toNetgsm($notifiable) {
        return "Test notification";
        // Or
        return new ShortMessage($notifiable->phone_number, 'Test notification');
    }
}
```

Don't forget to place the dedicated method for Netgsm inside your notifiables. (e.g. User)

```
class User extends Authenticatable
{
    use Notifiable;

    public function routeNotificationForNetgsm()
    {
        return "905123456789";
    }
}
```

### Available methods

[](#available-methods)

Netgsm can also be used directly to send short messages.

Examples:

```
Netgsm::sendShortMessage($to, $message);
Netgsm::sendShortMessages([[
    'recipient' => $to,
    'message'   => $message,
], [
    'recipient' => $anotherTo,
    'message'   => $anotherMessage,
]]);
```

see: [Netgsm-php](https://github.com/erdemkeren/Netgsm-php) documentation for more information.

### Available events

[](#available-events)

Netgsm Notification channel comes with handy events which provides the required information about the SMS messages.

1. **Message Was Sent** (`NotificationChannels\Netgsm\Events\MessageWasSent`)
2. **Messages Were Sent** (`NotificationChannels\Netgsm\Events\MessageWasSent`)
3. **Sending Message** (`NotificationChannels\Netgsm\Events\SendingMessage`)
4. **Sending Messages** (`NotificationChannels\Netgsm\Events\SendingMessages`)

Example:

```
namespace App\Listeners;

use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use NotificationChannels\Netgsm\Events\MessageWasSent;

class SentMessageHandler
{
    /**
     * Handle the event.
     *
     * @param  MessageWasSent  $event
     * @return void
     */
    public function handle(MessageWasSent $event)
    {
        $response = $event->response;
        $message = $event->message;
    }
}
```

### Notes

[](#notes)

$response-&gt;groupId() will throw BadMethodCallException if the client is set to 'http'. $response-&gt;messageReportIdentifiers() will throw BadMethodCallException if the client is set to 'xml'.

change client configuration with caution.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Bahri Meriç Canlı](https://github.com/bahricanli)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.1% 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 ~0 days

Total

2

Last Release

1139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4894f69d95bdf9814c8c0db5876852c4381ccaba0a2d98a224ea1269123217f8?d=identicon)[bmericc](/maintainers/bmericc)

---

Top Contributors

[![bmericc](https://avatars.githubusercontent.com/u/16552?v=4)](https://github.com/bmericc "bmericc (59 commits)")[![erdemkeren](https://avatars.githubusercontent.com/u/1636960?v=4)](https://github.com/erdemkeren "erdemkeren (21 commits)")[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (2 commits)")[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bahricanli-netgsm/health.svg)

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

###  Alternatives

[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[laravel-notification-channels/pusher-push-notifications

Pusher native Push Notifications driver.

282733.2k1](/packages/laravel-notification-channels-pusher-push-notifications)[spatie/laravel-backup-server

Backup multiple applications

17016.7k1](/packages/spatie-laravel-backup-server)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.3k](/packages/laravel-shift-curl-converter)

PHPackages © 2026

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