PHPackages                             nu1ww/mife - 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. nu1ww/mife

ActiveLibrary

nu1ww/mife
==========

dev

1.2(6y ago)1681MITPHPPHP &gt;=5.6

Since Mar 24Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nu1ww/mife)[ Packagist](https://packagist.org/packages/nu1ww/mife)[ RSS](/packages/nu1ww-mife/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Dialog MIFE Package
===================

[](#dialog-mife-package)

MIFE API Handler is a plugin to handle REST API request for Dialog External and Internal MIFE APIs

- Dialog SMS Gateway
- Dialog Charging Gateway

Requirements
------------

[](#requirements)

- PHP 5.6 +
- Phalcon / CI / CakePhp / Laravel 5.5+

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

[](#installation)

=&gt; Install the package by running this command in your terminal/cmd:

```
composer require nu1ww/mife

```

=&gt; You need to setup below values in .env file

```
MIFE_BASE_URL=https://extmife.dialog.lk/extapi/xxxxx
MIFE_GRANT_TYPE=client_credentials
MIFE_BASE_64_AUTH=xxxxVHVFd2NGNm9Qc2ZCemR2UUhBYTpmR3VqT3BN*********************
MIFE_APP_ID=xxx
MIFE_APP_PASSWORD=xxxxx
MIFE_LOG=true // You can disable the logs using true and false
MIFE_ACCESS_TOKEN_STORE=DB // You can select the either "DB" or "FILE" to store the access_token

```

=&gt; If you need keep record API request response logs in database set the below values in database and run MySql queries.

```
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=

```

=&gt; Please run below mysql queries

```
CREATE TABLE `mife_log`  (
`id` int(0) NOT NULL AUTO_INCREMENT,
`request_url` text,
`request_method` text,
`request_header` text,
`request_body` text,
`http_status` text,
`response_header` text,
`response_body` text,
`date_time` datetime(0) DEFAULT now(),
PRIMARY KEY (`id`)
);

#---------------------------------------

CREATE TABLE `mife_access_token`  (
`id` int(0) NOT NULL AUTO_INCREMENT,
`json` text,
`date_time` datetime(0) DEFAULT now(),
PRIMARY KEY (`id`)
);

```

=&gt; Send a SMS

```
$sendSms = new  \Mife\DialogSms\DialogSms();
$data = $sendSms->sendSms('779233884', 'This is test');
```

=&gt; To get session key

```
$bill = new  \Mife\DialogAddToBill\DialogAddToBill();
$data = $bill->getSessionKey();
```

=&gt; To check the credit balance

```
$bill = new  \Mife\DialogAddToBill\DialogAddToBill();
$data = $bill->creditCheck(779233884);
```

=&gt; Add to bill

```
$mobileNumber='777313687';
$invoiceNumber=3522;
$reasonCode=2071;
$amount=1;
$bill = new  \Mife\DialogAddToBill\DialogAddToBill();
$data = $bill->chargeToBill($mobileNumber, $invoiceNumber,$reasonCode, $amount);
```

It has following functions:

- Generate access token

```
MIFE::generateAccessToken();
```

- Get access token

```
MIFE::getAccessToken();
```

- Make the custom request

```
$accessToken = MIFE::getAccessToken();
$url = "https://extmife.dialog.lk/extapi/xyz";
$method = "POST";
$headers = [
    "Content-Type" => "application/json",
    "Authorization" => "Bearer " . $accessToken,
    "Accept" => "application/json",
];
$requestBody = [
    "param1" => 1234,
    "param2" => "param1",
];

// Rest API request and response get to a variable
$response = MIFE::apiCall($url, $method, $headers, $requestBody);

// Get response body
$response->getBody();

// Get status code
$response->getStatusCode();

// Get response headers
$response->getHeaders();
```

Author
------

[](#author)

- [**Nuwan Wijethilaka**](https://github.com/nu1ww)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

Special Thanks to
-----------------

[](#special-thanks-to)

- [LAYOUTindex](https://www.layoutindex.com/) Team

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.9% 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 ~8 days

Total

3

Last Release

2229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a0c4868fa775e86474ba6984ca94c27774334284a6cde482f09669b463899b2c?d=identicon)[nu1\_ww](/maintainers/nu1_ww)

---

Top Contributors

[![layoutindex](https://avatars.githubusercontent.com/u/56990823?v=4)](https://github.com/layoutindex "layoutindex (10 commits)")[![nu1ww](https://avatars.githubusercontent.com/u/2318937?v=4)](https://github.com/nu1ww "nu1ww (3 commits)")

---

Tags

addtobillcgmifesms

### Embed Badge

![Health badge](/badges/nu1ww-mife/health.svg)

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

###  Alternatives

[laravel/reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.

1.5k9.4M48](/packages/laravel-reverb)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[php-heroku-client/php-heroku-client

A PHP client for the Heroku Platform API

24404.8k4](/packages/php-heroku-client-php-heroku-client)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34170.2k2](/packages/onesignal-onesignal-php-api)

PHPackages © 2026

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