PHPackages                             johnes-ke/mpesa-php-api - 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. [Payment Processing](/categories/payments)
4. /
5. johnes-ke/mpesa-php-api

ActiveLibrary[Payment Processing](/categories/payments)

johnes-ke/mpesa-php-api
=======================

Safaricom Daraja M-pesa API for laravel framework

v2.0.4(2y ago)061MITPHPPHP ^8.1CI failing

Since Apr 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/johnes-ke/mpesa-php-api)[ Packagist](https://packagist.org/packages/johnes-ke/mpesa-php-api)[ Docs](https://github.com/johnes-ke/mpesa-php-api)[ RSS](/packages/johnes-ke-mpesa-php-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (0)

M-pesa PHP API FOR LARAVEL FRAMEWORK
====================================

[](#m-pesa-php-api-for-laravel-framework)

This package provides you with a simple tool to make requests to Safaricom Mpesa APIs so that you can focus on the development of your awesome application.

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

[](#installation)

Install via composer

```
composer require johnes-ke/mpesa-php-api
```

### Publish Configuration File

[](#publish-configuration-file)

```
php artisan vendor:publish --tag=mpesa-php-api-config
```

### Publish Database Migration File

[](#publish-database-migration-file)

```
php artisan vendor:publish --tag=mpesa-php-api-migrations
```

### IF YOU WANT TO GO LIVE/PRODUCTION READY

[](#if-you-want-to-go-liveproduction-ready)

Copy the variables in the `.env.example`. to the `.env` environment file . For the `MPESA_ENVIRONMENT` use `live` as the value for the production environment.

Usage
-----

[](#usage)

If you have not created your Safaricom Daraja Mpesa API application yet you can create one at [Safaricom Developer](https://developer.safaricom.co.ke/)

Example code to try

```
