PHPackages                             vincentbean/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vincentbean/laravel-plausible

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vincentbean/laravel-plausible
=============================

Laravel Plausible

2.4.0(5mo ago)2568.7k↑35.6%5MITPHPPHP ^8.3CI passing

Since Sep 7Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/VincentBean/laravel-plausible)[ Packagist](https://packagist.org/packages/vincentbean/laravel-plausible)[ Docs](https://github.com/vincentbean/laravel-plausible)[ GitHub Sponsors](https://github.com/VincentBean)[ RSS](/packages/vincentbean-laravel-plausible/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (16)Versions (18)Used By (0)

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

[](#laravel-plausible)

 [![Tests](https://camo.githubusercontent.com/ba879791f333f1727aba3ac0e4b7d341ab5ea2a3db093ccd69fac0fffd988d78/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76696e63656e746265616e2f6c61726176656c2d706c61757369626c652f74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/vincentbean/laravel-plausible) [![Coverage](https://camo.githubusercontent.com/cea72d305267469481a02161a2297fff89f54163d67334f621656190d368f9ae/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76696e63656e746265616e2f6c61726176656c2d706c61757369626c652f636f7665726167652e796d6c3f6c6162656c3d636f766572616765267374796c653d666c61742d737175617265)](https://github.com/vincentbean/laravel-plausible) [![Analysis](https://camo.githubusercontent.com/6d9863d4d3efd36541e6595713eb9a7bb588a0027062c664a8e6c6e91e6f2e6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f76696e63656e746265616e2f6c61726176656c2d706c61757369626c652f616e616c7973652e796d6c3f6c6162656c3d616e616c79736973267374796c653d666c61742d737175617265)](https://github.com/vincentbean/laravel-plausible) [![Total downloads](https://camo.githubusercontent.com/8dfa39a27a6bb495f4bc9f928df80960add54dd02b52b66d0d85a07071742976/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76696e63656e746265616e2f6c61726176656c2d706c61757369626c653f636f6c6f723d626c7565267374796c653d666c61742d737175617265)](https://github.com/vincentbean/laravel-plausible)

This package provides a blade view with the script tag for plausible and a wrapper to easily send custom events to Plausible.

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

[](#installation)

You can install the package via composer:

```
composer require vincentbean/laravel-plausible
```

You can publish the config file with:

```
php artisan vendor:publish --provider="VincentBean\Plausible\LaravelPlausibleServiceProvider" --tag="config"
```

Add the following to your env:

```
PLAUSIBLE_TRACKING_DOMAIN=DOMAIN_YOU_WANT_TO_TRACK
PLAUSIBLE_DOMAIN=OPTIONAL_IF_SELF_HOSTING

```

Usage
-----

[](#usage)

This package supports both client side and server side tracking.

### Client Side Tracking

[](#client-side-tracking)

Include the component in your layout to add the plausible script, with optional tracking extensions.

```

or

```

Plausible will be available on the window object for sending custom events via Javascript:

```
plausible('event')
```

### Server Side Tracking

[](#server-side-tracking)

Track pageviews server side using middleware.

Laravel 11:

```
// bootstrap/app.php
    return Application::configure(basePath: dirname(__DIR__))
        // ...
        ->withMiddleware(function (Middleware $middleware) {
            // Append this middleware to track globally
            $middleware->web(append: [\VincentBean\Plausible\Middleware\TrackPlausiblePageviews::class]);
        })
        // ...
```

Laravel 10 and earlier versions:

```
// app/Http/Kernel.php
    'web' => [
        // Add this middleware to the web group to track globally
        \VincentBean\Plausible\Middleware\TrackPlausiblePageviews::class,
    ],
```

### Custom Events

[](#custom-events)

You can trigger custom events on the server.

```
\VincentBean\Plausible\Events\PlausibleEvent::fire('custom event', ['country' => 'netherlands']);
```

If firing your event from a queued job or event listener, it might be necessary to pass on the user's `ip` and `user-agent` string which are used by Plausible to generate user session ID's.

```
\VincentBean\Plausible\Events\PlausibleEvent::fire('custom event', ['country' => 'netherlands'], headers: [
    'X-Forwarded-For' => $event->userIp,
    'user-agent' => $event->userAgent
]);
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Vincent Bean](https://github.com/VincentBean)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance73

Regular maintenance activity

Popularity42

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

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

Every ~110 days

Recently: every ~184 days

Total

16

Last Release

152d ago

Major Versions

1.x-dev → 2.0.02023-12-12

PHP version history (4 changes)1.0.0PHP ^7.4|^8.0

2.0.0PHP ^8.0

2.3.0PHP ^8.2

2.4.0PHP ^8.3

### Community

Maintainers

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

---

Top Contributors

[![VincentBean](https://avatars.githubusercontent.com/u/3906942?v=4)](https://github.com/VincentBean "VincentBean (53 commits)")[![asbiin](https://avatars.githubusercontent.com/u/25419741?v=4)](https://github.com/asbiin "asbiin (15 commits)")[![bricehartmann](https://avatars.githubusercontent.com/u/9779486?v=4)](https://github.com/bricehartmann "bricehartmann (6 commits)")[![tobz-nz](https://avatars.githubusercontent.com/u/443054?v=4)](https://github.com/tobz-nz "tobz-nz (5 commits)")[![jorisdrenth](https://avatars.githubusercontent.com/u/10384146?v=4)](https://github.com/jorisdrenth "jorisdrenth (3 commits)")[![mathiaspalmqvist](https://avatars.githubusercontent.com/u/51116221?v=4)](https://github.com/mathiaspalmqvist "mathiaspalmqvist (3 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (1 commits)")[![quintenbuis](https://avatars.githubusercontent.com/u/36452184?v=4)](https://github.com/quintenbuis "quintenbuis (1 commits)")

---

Tags

laravelVincentBeanlaravel-plausible

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k113.1M997](/packages/laravel-socialite)[laravel/boost

Laravel Boost accelerates AI-assisted development by providing the essential context and structure that AI needs to generate high-quality, Laravel-specific code.

3.6k26.0M804](/packages/laravel-boost)[nativephp/mobile

NativePHP for Mobile

1.1k102.1k146](/packages/nativephp-mobile)[spatie/laravel-health

Monitor the health of a Laravel application

88212.7M188](/packages/spatie-laravel-health)[spatie/laravel-export

Create a static site bundle from a Laravel app

679153.2k7](/packages/spatie-laravel-export)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

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

PHPackages © 2026

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