PHPackages                             ab-alselwi/hisms-ws-notification-channel - 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. ab-alselwi/hisms-ws-notification-channel

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

ab-alselwi/hisms-ws-notification-channel
========================================

Hisms.ws Notification Channel for laravel.

321PHP

Since Oct 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Ab-Alselwi/hisms-ws-notification-channel)[ Packagist](https://packagist.org/packages/ab-alselwi/hisms-ws-notification-channel)[ RSS](/packages/ab-alselwi-hisms-ws-notification-channel/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Hisms.ws Notification Channel
=====================================

[](#laravel-hismsws-notification-channel)

This package makes it easy to send notifications using [HismsWs](https://www.hisms.ws) with Laravel 8.x.

This package was inspired by :

- [twilio](https://github.com/laravel-notification-channels/twilio)
- [laravel-mobily-ws-notification](https://github.com/alhoqbani/laravel-mobily-ws-notification)

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Package Installation](#package-installation)
    - [Set up hisms.ws account](#set-up-hisms.ws-account)
- [Usage](#usage)
    - [Credentials](#credentials)
    - [Create Notification](#create-notification)
    - [Routing SMS Notifications](#routing-sms-notifications)
    - [Sending SMS](#sending-sms)

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

[](#installation)

### Package Installation

[](#package-installation)

Install the package using composer:

```
composer require ab-alselwi/hisms-ws-notification-channel
```

Add service provider to your array of providers in `config/app.php`

> You don't need to do this step for laravel 8.0+

```
        NotificationChannels\HismsWs\HismsWsServiceProvider::class,
```

Publish the configuration file:

```
php artisan vendor:publish --provider="NotificationChannels\HismsWs\HismsWsServiceProvider"
```

### Set up hisms.ws account

[](#set-up-hismsws-account)

You must have an account with [HismsWs](https://www.hisms.ws) to be able to use this package.

#### Credentials.

[](#credentials)

There are two methods of authentication when using hisms.ws api.

You could send requests using your login credentials (mobile/password), or by using the apiKey which you can generate from your hisms.ws account.

You must add hisms.ws credentials to your `.env` file.

```
// Mobile number and password used for log in.
HISMS_WS_MOBILE=
HISMS_WS_PASSWORD=

// name/number of the sender which must be approved by hisms.ws for GCC
HISMS_WS_SENDER=

```

##### Which method to use:

[](#which-method-to-use)

You can define the authentication method you would like to use by editing your `config/hismsWs` file.

```
// config/hismsws

     // Set yor login credentials to communicate with hisms.ws Api
    'mobile' => env('HISMS_WS_MOBILE'),
    'password' =>  env('HISMS_WS_PASSWORD'),

    // Name of Sender must be approved by hisms.ws
    'sender' => env('HISMS_WS_SENDER'),
```

Usage
-----

[](#usage)

### Create new notification:

[](#create-new-notification)

Make a new notification class using laravel artisan

```
php artisan make:notification UserRegistered
```

and configure the notification class to use HismsWsChannel.

The `toHismsWs` method should return a string of the text message to be sent or an instance of `HismsWsMessage`.

```
