PHPackages                             wdev-rs/laravel-analytics - 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. wdev-rs/laravel-analytics

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

wdev-rs/laravel-analytics
=========================

Collect page view data in your application without third party tracking

0.2.3(2y ago)151.2k2[6 issues](https://github.com/wdev-rs/laravel-analytics/issues)[1 PRs](https://github.com/wdev-rs/laravel-analytics/pulls)MITPHPPHP ^8.0

Since Mar 31Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (5)Versions (8)Used By (0)

Very short description of the package
=====================================

[](#very-short-description-of-the-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/35533c074d86be84d8589dcbc8ef6946c2a98957eb53d1a21c62cbdf51106e19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776465762d72732f6c61726176656c2d616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wdev-rs/laravel-analytics)[![Total Downloads](https://camo.githubusercontent.com/a9b234dadefc77b3c9a9e58285611f801d167205dbfcc42fc17a3a7ed5cd5400/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776465762d72732f6c61726176656c2d616e616c79746963732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wdev-rs/laravel-analytics)[![GitHub Actions](https://github.com/wdev-rs/laravel-analytics/actions/workflows/main.yml/badge.svg)](https://github.com/wdev-rs/laravel-analytics/actions/workflows/main.yml/badge.svg)

This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.

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

[](#installation)

You can install the package via composer:

```
composer require wdev-rs/laravel-analytics
```

Install the vue-chartjs integration

```
npm install vue-chartjs@^4.0.0 chart.js
```

Publish the vendor files by running

```
php artisan vendor:publish --provider="WdevRs\LaravelAnalytics\LaravelAnalyticsServiceProvider"
```

Usage
-----

[](#usage)

Run migration

```
php artisan migrate
```

Add alias to middleware in `app/Http/Kernel.php`

```
    protected $routeMiddleware = [
        ...
        'analytics' => \WdevRs\LaravelAnalytics\Http\Middleware\Analytics::class,
        ...
    ];
```

Add the `analytics` middleware to the routes you'd like to track

```
Route::middleware(['analytics'])->group(function () {
    Route::get('/', [PagesController::class,'index'])->name('pages.home');
});
```

### Admin

[](#admin)

Register the vue components to display analytics

```
Vue.component('page-views-per-days', require('./vendor/laravel-analytics/components/PageViewsPerDays.vue').default);
Vue.component('page-views-per-paths', require('./vendor/laravel-analytics/components/PageViewsPerPaths.vue').default);
```

Use the components in your dashboard or where you like :)

Pass the data from controller

```
        $pageViewRepository = app(PageViewRepository::class);
        $pageViewsPerDays = $pageViewRepository->getByDateGroupedByDays(Carbon::today()->subDays(28));
        $pageViewsPerPaths = $pageViewRepository->getByDateGroupedByPath(Carbon::today()->subDays(28));

        return view('admin.dashboard.index',
            [
                'pageViewsPerDays' => $pageViewsPerDays,
                'pageViewsPerPaths' => $pageViewsPerPaths
            ]);
```

```

```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

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

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

[](#contributing)

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

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Daniel Werner](https://github.com/wdev-rs)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.6% 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 ~93 days

Total

5

Last Release

773d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9d3224345657674b5199e36cc4cadc9d7d90e6d272bf004114254290d4c8007?d=identicon)[wdev-rs](/maintainers/wdev-rs)

---

Top Contributors

[![daniel-werner](https://avatars.githubusercontent.com/u/38726367?v=4)](https://github.com/daniel-werner "daniel-werner (25 commits)")[![nexxai](https://avatars.githubusercontent.com/u/4316564?v=4)](https://github.com/nexxai "nexxai (2 commits)")

---

Tags

laravel-analyticswdev-rs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wdev-rs-laravel-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/wdev-rs-laravel-analytics/health.svg)](https://phpackages.com/packages/wdev-rs-laravel-analytics)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[shetabit/visitor

Laravel visitor

565578.2k8](/packages/shetabit-visitor)[illuminate/pipeline

The Illuminate Pipeline package.

9346.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)[mrmarchone/laravel-auto-crud

Laravel Auto CRUD helps you streamline development and save time.

28711.8k2](/packages/mrmarchone-laravel-auto-crud)

PHPackages © 2026

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