PHPackages                             nakatsinho/mpesa-laravel - 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. nakatsinho/mpesa-laravel

ActiveLibrary[Payment Processing](/categories/payments)

nakatsinho/mpesa-laravel
========================

This is the latest simplified way to embed Mpesa payments in your laravel application.

712[1 issues](https://github.com/nakatsinho/mpesa-vm-laravel-sdk/issues)PHP

Since Apr 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/nakatsinho/mpesa-vm-laravel-sdk)[ Packagist](https://packagist.org/packages/nakatsinho/mpesa-laravel)[ RSS](/packages/nakatsinho-mpesa-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Package for Mpesa - Vodacom Mozambique 🇲🇿
=================================================

[](#laravel-package-for-mpesa---vodacom-mozambique-)

This is the latest simplified way to embed Mpesa payments for Mozambique in your Laravel app. And this is an improvement from past integrations already tested.

M-Pesa Developer Portal
-----------------------

[](#m-pesa-developer-portal)

I consider it essential to read a little more about the working principle of this SDK, accessing the following link: [VM - Developer Portal](https://developer.mpesa.vm.co.mz/documentation/)

Pilot of you Laravel Project
----------------------------

[](#pilot-of-you-laravel-project)

First consider important/mandatory that your project fulfills the following requirements, required for the execution of this package

#### Requisitos:

[](#requisitos)

- PhP Version : &gt;= 7.0;
- Laravel Framework : &gt;= 5.8;

Package Installation:
---------------------

[](#package-installation)

1. If you haven't created your project yet, create your laravel project with the following steps, using Composer on the command line:

```
composer create-project laravel/laravel:^8.0 example-app

```

1. Navigate to your project's root directory and using composer on the command line, write the following:

```
composer require nakatsinho/mpesa-laravel

```

2. But with that we didn't reach the icing on the cake, together with the package, there are a series of files that we need to publish in your project, which will allow you to access the features of that package, through the following command via artisan:

```
php artisan mpesa-sdk:publish

```

#### GOOD DJOB 🔥...

[](#good-djob-)

Now we have the basics to test! Note that the command above brought us the following files:

- **config/mpesa.php** - The config file that help you to place your M-Pesa Credentials that can be find on VM Portal, just for test;
- **controllers/PaymentController.php** - A controller to call the payment form and make request;
- **views/payments/index.blade.php** - A Blade view with any form to make test request for c2b method;

Explanation and Configuration:
------------------------------

[](#explanation-and-configuration)

Be sure to get and set your files like those following:

#### config/mpesa.php

[](#configmpesaphp)

```
