PHPackages                             kilobyteno/laravel-plausible - 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. [API Development](/categories/api)
4. /
5. kilobyteno/laravel-plausible

ActiveLibrary[API Development](/categories/api)

kilobyteno/laravel-plausible
============================

A simple package for communicating with the Plausible API within Laravel.

1.3.0(1y ago)75.2k↓50%[4 issues](https://github.com/kilobyteno/laravel-plausible/issues)[1 PRs](https://github.com/kilobyteno/laravel-plausible/pulls)1MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI passing

Since Apr 27Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/kilobyteno/laravel-plausible)[ Packagist](https://packagist.org/packages/kilobyteno/laravel-plausible)[ Docs](https://github.com/kilobyteno/laravel-plausible)[ RSS](/packages/kilobyteno-laravel-plausible/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (12)Versions (8)Used By (1)

Laravel Plausible
=================

[](#laravel-plausible)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9ec660836f30a5da9be97300f2c8231395408370b824fd3a9c984f5cb314947e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b696c6f627974656e6f2f6c61726176656c2d706c61757369626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kilobyteno/laravel-plausible)[![GitHub Tests Action Status](https://camo.githubusercontent.com/ac65a45a18d901ef6f2b70385af6883a9c28088c9e35050d149561217e67bd12/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b696c6f627974656e6f2f6c61726176656c2d706c61757369626c652f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/kilobyteno/laravel-plausible/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6676f2918054d6d9a124b3388dc4134f6893940d7e289df0f04d653777b17a63/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b696c6f627974656e6f2f6c61726176656c2d706c61757369626c652f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/kilobyteno/laravel-plausible/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/37be77b0ec13685460f0cf5c30664e10987039fdc748e92f1ba38d9d82052767/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b696c6f627974656e6f2f6c61726176656c2d706c61757369626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kilobyteno/laravel-plausible)

A simple package for communicating with the Plausible API within Laravel.

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

[](#installation)

You can install the package via composer:

```
composer require kilobyteno/laravel-plausible
```

You can publish the config file with:

```
php artisan vendor:publish --tag="plausible-config"
```

This is the contents of the published config file:

```
return [
    'api_url' => env('PLAUSIBLE_API_URL', 'https://plausible.io/api/v1'),
    'api_key' => env('PLAUSIBLE_API_KEY', ''),
];
```

Usage
-----

[](#usage)

```
use Kilobyteno\LaravelPlausible\Plausible;

// Show the stats for the default period (30d), the period is optional for all methods
$visitors = Plausible::getVisitors($domain->name);

// Show the stats for the last 12 months
$pageviews = Plausible::getPageviews($domain->name, '12mo');

// Get bounce rates for the last 7 days
$bounceRate = Plausible::getBounceRate($domain->name, '7d');

// Get visit duration for the last days
$visitDuration = Plausible::getVisitDuration($domain->name, 'day');

// Get realtime visitors
$realtimeVisitors = Plausible::getRealtimeVisitors($domain->name);

// Add a custom period and metrics
$stats = Plausible::get($domain->name, 'month', ['visitors', 'pageviews']);

$availablePeriods = Plausible::getAllowedPeriods();
// returns: ['12mo', '6mo', 'month', '30d', '7d', 'day']

$allowedMetrics = Plausible::getAllowedMetrics();
// returns: ['visitors', 'pageviews', 'bounce_rate', 'visit_duration', 'visits', 'events']

$allowedProperties = Plausible::getAllowedProperties();
/*
returns [
    'event:name',
    'event:page',
    'visit:entry_page',
    'visit:exit_page',
    'visit:source',
    'visit:referrer',
    'visit:utm_medium',
    'visit:utm_source',
    'visit:utm_campaign',
    'visit:utm_content',
    'visit:utm_term',
    'visit:device',
    'visit:browser',
    'visit:browser_version',
    'visit:os',
    'visit:os_version',
    'visit:country',
];
*/
```

### Catching exceptions

[](#catching-exceptions)

```
use Kilobyteno\LaravelPlausible\Exceptions\PlausibleAPIException;

try {
    $visitors = Plausible::getVisitors($domain->name);
} catch (PlausibleAPIException $e) {
    // Handle exception
}
```

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)

- [Kilobyte AS](https://github.com/kilobyteno)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance61

Regular maintenance activity

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~215 days

Recently: every ~268 days

Total

6

Last Release

399d ago

Major Versions

0.0.2 → 1.0.02023-07-19

PHP version history (4 changes)0.0.1PHP ^8.0|^8.1

1.1.0PHP ^8.0|^8.1|^8.2

1.2.0PHP ^8.0|^8.1|^8.2|^8.3

1.3.0PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

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

---

Top Contributors

[![dsbilling](https://avatars.githubusercontent.com/u/9788214?v=4)](https://github.com/dsbilling "dsbilling (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (18 commits)")

---

Tags

api-wrapperhelp-wantedlaravellaravel-packageplausible-analyticslaravelplausiblelaravel-plausiblekilobyteno

###  Code Quality

TestsPest

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/kilobyteno-laravel-plausible/health.svg)

```
[![Health](https://phpackages.com/badges/kilobyteno-laravel-plausible/health.svg)](https://phpackages.com/packages/kilobyteno-laravel-plausible)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.0k7.8M57](/packages/dedoc-scramble)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)[combindma/laravel-facebook-pixel

Meta pixel integration for Laravel

4956.9k](/packages/combindma-laravel-facebook-pixel)[stechstudio/laravel-hubspot

A Laravel SDK for the HubSpot CRM Api

2971.0k](/packages/stechstudio-laravel-hubspot)

PHPackages © 2026

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