PHPackages                             plusinfolab/cashier-saas-metrics - 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. plusinfolab/cashier-saas-metrics

ActiveLibrary[Payment Processing](/categories/payments)

plusinfolab/cashier-saas-metrics
================================

SaaS metrics analyzer for Laravel. Track MRR, churn, LTV, ARPU, and cohort analysis with Stripe, Paddle, and custom billing providers.

v1(3mo ago)0206—2%[2 PRs](https://github.com/plusinfolab/cashier-saas-metrics/pulls)MITPHPPHP ^8.4CI passing

Since Mar 24Pushed 3d agoCompare

[ Source](https://github.com/plusinfolab/cashier-saas-metrics)[ Packagist](https://packagist.org/packages/plusinfolab/cashier-saas-metrics)[ Docs](https://github.com/plusinfolab/cashier-saas-metrics)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/plusinfolab-cashier-saas-metrics/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (18)Versions (4)Used By (0)

Cashier SaaS Metrics
====================

[](#cashier-saas-metrics)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7044145ee56d943e230f5453d77a6946c76409817075c019d838382764618a7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706c7573696e666f6c61622f636173686965722d736161732d6d6574726963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/plusinfolab/cashier-saas-metrics)[![GitHub Tests Action Status](https://camo.githubusercontent.com/39dc309bd351f1f3399f6a9de8eb67cda14eed3271d9372eae916ddcce8a7750/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c7573696e666f6c61622f636173686965722d736161732d6d6574726963732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/plusinfolab/cashier-saas-metrics/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/facc36acabbecb25295539a5d5bd73797dd2ae72c269525c33f77edde27202d2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f706c7573696e666f6c61622f636173686965722d736161732d6d6574726963732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/plusinfolab/cashier-saas-metrics/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3604bb373461bb27061a79accc42bb45ada661e290eaae03704644eb2e3fc708/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706c7573696e666f6c61622f636173686965722d736161732d6d6574726963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/plusinfolab/cashier-saas-metrics)

A comprehensive SaaS metrics analyzer for Laravel that provides actionable insights for subscription-based businesses. Track MRR, churn rate, LTV, ARPU, and cohort analysis with support for Stripe, Paddle, and custom billing providers.

Highlights
----------

[](#highlights)

- 📊 **Pre-built Metric Calculators** - MRR, churn rate, LTV, ARPU, and cohort analysis
- 🔌 **Multi-Provider Support** - Works with Stripe, Paddle, LemonSqueezy, or custom billing
- ⚡ **Cache-First Architecture** - Intelligent caching with automatic invalidation
- 🎨 **Dashboard Components** - Ready-to-use Blade components for Laravel
- 📈 **Cohort Analysis** - First-class cohort tracking with retention curves
- 🔄 **Auto Recalculation** - Background jobs keep metrics fresh

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

[](#installation)

You can install the package via composer:

```
composer require plusinfolab/cashier-saas-metrics
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="saas-metrics-migrations"
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="saas-metrics-config"
```

This is the contents of the published config file:

```
return [
    'provider' => env('SAAS_METRICS_PROVIDER', 'stripe'),
    'base_currency' => env('SAAS_METRICS_BASE_CURRENCY', 'USD'),
    // ... other configuration
];
```

Usage
-----

[](#usage)

### Basic Metrics

[](#basic-metrics)

```
use PlusInfoLab\CashierSaaSMetrics\Facades\Metrics;

// Get current MRR
$mrr = Metrics::mrr()->calculate();
echo $mrr->formattedAsCurrency(); // "$42,500.00"

// Get churn rate
$churnRate = Metrics::churnRate()->calculate();
echo $churnRate->formattedAsPercentage(); // "4.25%"

// Get LTV
$ltv = Metrics::lifetimeValue()->calculate();
echo $ltv->formattedAsCurrency(); // "$1,200.00"

// Get ARPU
$arpu = Metrics::arpu()->calculate();
echo $arpu->formattedAsCurrency(); // "$85.00"
```

### Filtering and Grouping

[](#filtering-and-grouping)

```
// Filter by period
$mrrThisMonth = Metrics::mrr()
    ->period('last_month')
    ->calculate();

// Filter by plan
$proMrr = Metrics::mrr()
    ->plan('pro')
    ->calculate();

// Group by field
$mrrByPlan = Metrics::mrr()
    ->groupBy('plan')
    ->calculate();

// Filter by currency
$usdMrr = Metrics::mrr()
    ->currency('USD')
    ->calculate();
```

### Cohort Analysis

[](#cohort-analysis)

```
$cohorts = Metrics::cohorts()
    ->period('last_6_months')
    ->by('signup_month')
    ->retentionMetric('mrr')
    ->calculate();

// Returns cohort data with retention curves
foreach ($cohorts->value as $cohortKey => $cohortData) {
    foreach ($cohortData['periods'] as $period) {
        echo "Period {$period['period']}: {$period['retention_percentage']}% retention\n";
    }
}
```

### Dashboard Components

[](#dashboard-components)

```

```

Or use individual metric cards:

```

```

### All Metrics at Once

[](#all-metrics-at-once)

```
$dashboard = Metrics::dashboard('this_month');

/*
[
    'mrr' => MetricResult(42500),
    'churn_rate' => MetricResult(0.0425),
    'ltv' => MetricResult(1200),
    'arpu' => MetricResult(85),
    'period' => 'this_month',
    'currency' => 'USD',
]
*/
```

Subscription Providers
----------------------

[](#subscription-providers)

### Stripe (using Laravel Cashier)

[](#stripe-using-laravel-cashier)

```
// config/saas-metrics.php
'provider' => 'stripe',

'providers' => [
    'stripe' => [
        'api_key' => env('STRIPE_SECRET'),
        'webhook_secret' => env('STRIPE_WEBHOOK_SECRET'),
    ],
],
```

### Paddle

[](#paddle)

```
'provider' => 'paddle',

'providers' => [
    'paddle' => [
        'vendor_id' => env('PADDLE_VENDOR_ID'),
        'auth_code' => env('PADDLE_AUTH_CODE'),
    ],
],
```

### Custom Provider

[](#custom-provider)

```
'provider' => 'custom',

'providers' => [
    'custom' => [
        'models' => [
            'subscription' => App\Models\Subscription::class,
            'payment' => App\Models\Payment::class,
        ],
        'field_map' => [
            'id' => 'id',
            'status' => 'status',
            'amount' => 'amount',
            // ... map your model fields
        ],
    ],
],
```

Cache Invalidation
------------------

[](#cache-invalidation)

The package automatically invalidates cache when subscription events occur. You can dispatch events manually:

```
use PlusInfoLab\CashierSaaSMetrics\Events\SubscriptionCreated;
use PlusInfoLab\CashierSaaSMetrics\Events\SubscriptionCancelled;
use PlusInfoLab\CashierSaaSMetrics\Events\SubscriptionUpdated;

// When a subscription is created
event(new SubscriptionCreated($subscriptionId, $customerId));

// When a subscription is cancelled
event(new SubscriptionCancelled($subscriptionId, $customerId));

// When a subscription is updated
event(new SubscriptionUpdated($subscriptionId, $customerId, $changes));
```

Or clear cache manually:

```
// Clear all metrics cache
Metrics::clearCache();

// Clear specific metric cache
Metrics::clearMetricCache('mrr');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [PlusInfoLab](https://github.com/plusinfolab)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance92

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60.4% 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

Unknown

Total

1

Last Release

94d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/113779419?v=4)[Aditya Jodhani](/maintainers/amjpdevp)[@amjpdevp](https://github.com/amjpdevp)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (388 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (33 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (23 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (20 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (12 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (10 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (10 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (8 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (5 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![abenerd](https://avatars.githubusercontent.com/u/7523903?v=4)](https://github.com/abenerd "abenerd (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (3 commits)")[![maartenpaauw](https://avatars.githubusercontent.com/u/4550875?v=4)](https://github.com/maartenpaauw "maartenpaauw (3 commits)")

---

Tags

laravelstripeMetricsanalyticssubscriptionsaascashierchurnplusinfolabLTVmrrrevenue

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/plusinfolab-cashier-saas-metrics/health.svg)

```
[![Health](https://phpackages.com/badges/plusinfolab-cashier-saas-metrics/health.svg)](https://phpackages.com/packages/plusinfolab-cashier-saas-metrics)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M280](/packages/laravel-horizon)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

43140.3k](/packages/harris21-laravel-fuse)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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