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

ActiveLibrary[Payment Processing](/categories/payments)

felixmuhoro/laravel-mpesa-filament
==================================

A Filament v3 admin panel plugin for managing M-Pesa transactions

v1.0.0(1mo ago)00MITPHPPHP ^8.1

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/felixmuhoro/laravel-mpesa-filament)[ Packagist](https://packagist.org/packages/felixmuhoro/laravel-mpesa-filament)[ Docs](https://github.com/felixmuhoro/laravel-mpesa-filament)[ RSS](/packages/felixmuhoro-laravel-mpesa-filament/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

laravel-mpesa-filament
======================

[](#laravel-mpesa-filament)

A production-quality **Filament v3** admin panel plugin for managing **M-Pesa** transactions in Laravel applications.

Built on top of [`felixmuhoro/laravel-mpesa`](https://github.com/felixmuhoro/laravel-mpesa), this package gives you a complete admin interface for your M-Pesa integration without writing a single line of UI code.

---

Features
--------

[](#features)

- **Transaction Resource** — searchable, filterable, sortable table of all M-Pesa transactions with date range, status, type and amount filters
- **Revenue Stats Widget** — today's revenue, monthly revenue, 30-day success rate, failed transaction count with trend indicators
- **Revenue Chart Widget** — 30-day line chart of revenue or transaction volume (switchable)
- **Latest Transactions Widget** — last N transactions at a glance
- **M-Pesa Dashboard Page** — all widgets combined on a single dedicated page
- **CSV Export** — export all or selected transactions to CSV
- **STK Push Action** — trigger an STK Push directly from the admin panel
- **Fluent plugin config** — navigation group, sort, and access control via `MpesaFilamentPlugin::make()`

---

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

[](#requirements)

RequirementVersionPHP^8.1Laravel^10.0 | ^11.0 | ^12.0 | ^13.0Filament^3.0felixmuhoro/laravel-mpesa^1.2---

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

[](#installation)

```
composer require felixmuhoro/laravel-mpesa-filament
```

Publish the config (optional):

```
php artisan vendor:publish --tag="mpesa-filament-config"
```

---

Setup
-----

[](#setup)

Register the plugin on your Filament panel inside your `PanelProvider`:

```
use FelixMuhoro\MpesaFilament\MpesaFilamentPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ... your other panel config
        ->plugin(
            MpesaFilamentPlugin::make()
                ->navigationGroup('Finance')   // optional, default: 'M-Pesa'
                ->navigationSort(10)           // optional
                ->canViewAny(true)             // optional, default: true
        );
}
```

---

Configuration
-------------

[](#configuration)

After publishing, edit `config/mpesa-filament.php`:

```
return [
    'navigation_group'         => 'M-Pesa',
    'navigation_sort'          => null,

    // Override with your own model if needed
    'transaction_model'        => \FelixMuhoro\Mpesa\Models\MpesaTransaction::class,

    'currency_symbol'          => 'KES',
    'chart_days'               => 30,
    'latest_transactions_limit' => 10,

    // Map status strings to Filament badge colors
    'status_colors' => [
        'completed'  => 'success',
        'successful' => 'success',
        'success'    => 'success',
        'failed'     => 'danger',
        'failure'    => 'danger',
        'pending'    => 'warning',
        'processing' => 'info',
        'cancelled'  => 'gray',
    ],

    // Columns included in CSV exports
    'export_columns' => [
        'receipt_number',
        'phone_number',
        'amount',
        'status',
        'transaction_type',
        'created_at',
    ],
];
```

---

Plugin API
----------

[](#plugin-api)

### `MpesaFilamentPlugin`

[](#mpesafilamentplugin)

MethodDescription`make()`Create plugin instance (use in panel provider)`navigationGroup(string $group)`Set the sidebar navigation group label`navigationSort(int $sort)`Set sort order within the group`canViewAny(bool $condition)`Toggle whether any user can access the resources`withTransactionResource(bool)`Enable/disable the Transaction resource`withDashboardPage(bool)`Enable/disable the M-Pesa Dashboard page`withWidgets(bool)`Enable/disable the stats/chart/table widgets---

Included Components
-------------------

[](#included-components)

### Resources

[](#resources)

#### `TransactionResource`

[](#transactionresource)

Full Filament resource for the `mpesa_transactions` table.

**Columns:** Receipt Number, Phone, Amount (formatted KES), Status (badge), Type (badge), Reference, Date

**Filters:**

- Date range (from / until)
- Status (multi-select)
- Transaction Type (multi-select)
- Amount range (min / max)

**Actions:**

- View transaction detail (Infolist)
- STK Push header action
- Bulk export selected rows to CSV

### Widgets

[](#widgets)

#### `RevenueStatsWidget`

[](#revenuestatswidget)

Four stat cards:

1. Today's Revenue vs yesterday (with sparkline)
2. This Month's Revenue vs last month
3. 30-day Success Rate (%)
4. Failed Transactions Today

#### `RevenueChartWidget`

[](#revenuechartwidget)

30-day line chart with a toggle filter between **Revenue (KES)** and **Transaction Count**.

#### `LatestTransactionsWidget`

[](#latesttransactionswidget)

Table of the last N transactions (configurable via `latest_transactions_limit`).

### Pages

[](#pages)

#### `MpesaDashboardPage`

[](#mpesadashboardpage)

Dedicated admin page at `/mpesa-dashboard` combining all three widgets. Registered in the same navigation group as the Transaction resource.

### Actions

[](#actions)

#### `InitiateStkPushAction`

[](#initiatestkpushaction)

Can be added to any table or page. Opens a modal form with:

- Phone number (with 254XXXXXXXXX validation)
- Amount (KES, 1–150,000)
- Account Reference (max 12 chars)
- Description (max 13 chars)

Calls `Mpesa::stkPush()` and shows a success or error notification.

```
use FelixMuhoro\MpesaFilament\Actions\InitiateStkPushAction;

// In a custom table:
->actions([
    InitiateStkPushAction::make(),
])
```

### Filters

[](#filters)

#### `DateRangeFilter`

[](#daterangefilter)

Reusable date-range filter for any table column:

```
use FelixMuhoro\MpesaFilament\Filters\DateRangeFilter;

->filters([
    DateRangeFilter::make('created_at'),
    DateRangeFilter::make('updated_at'),
])
```

---

Testing
-------

[](#testing)

```
composer test
```

Tests use Pest and cover list rendering, search, all four filter types, sorting, view page, and permission helpers.

---

Changelog
---------

[](#changelog)

### v1.0.0

[](#v100)

- Initial release

---

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) for details.

---

Credits
-------

[](#credits)

Built by [Felix Muhoro](https://felixmuhoro.dev).

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4e43995a8ec026a33d25263c30f437674d6d8481092cb3acd64e96e4ba3f4e4?d=identicon)[felixmuhoro](/maintainers/felixmuhoro)

---

Tags

laravelmpesakenyasafaricom

### Embed Badge

![Health badge](/badges/felixmuhoro-laravel-mpesa-filament/health.svg)

```
[![Health](https://phpackages.com/badges/felixmuhoro-laravel-mpesa-filament/health.svg)](https://phpackages.com/packages/felixmuhoro-laravel-mpesa-filament)
```

PHPackages © 2026

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