PHPackages                             wanderreisen/laravel-popular - 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. wanderreisen/laravel-popular

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

wanderreisen/laravel-popular
============================

A Laravel package to track popularity of entries(by Models) in a website at a certain time.

1.0.6(5y ago)190MITPHPPHP ~5.6|~7.2

Since Sep 1Pushed 4y agoCompare

[ Source](https://github.com/wanderreisen/laravel-popular)[ Packagist](https://packagist.org/packages/wanderreisen/laravel-popular)[ Docs](https://github.com/jordanmiguel/laravel-popular)[ RSS](/packages/wanderreisen-laravel-popular/feed)WikiDiscussions master Synced 3d ago

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

Laravel Popular (Laravel Popularity)
====================================

[](#laravel-popular-laravel-popularity)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cdffb192fa416e5a3db2188c9f653db10b193fb24b6572166af1c3abc872087c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77616e64657272656973656e2f6c61726176656c2d706f70756c61722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/wanderreisen/laravel-popular)[![MIT licensed](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](license.md)

With Laravel Popular Package you can Track your most popular Eloquent Models based on unique hits in a time range and then sort by popularity in a time frame.

Usage
-----

[](#usage)

Use the visitable trait on the model you intend to track

```
use \Wanderreisen\LaravelPopular\Traits\Visitable;

class Post extends Model
{
    use Visitable;

    ...
}
```

Here are some code examples:

```
// Adding a visit to the post. Recommended on the show() method of your controller.
$post->visit();

// Retrieving the count of visitors in a timeframe
$post->visitsDay();
$post->visitsWeek();
$post->visitsMonth();
$post->visitsForever();

// Ordering the posts by the most visited
Posts::popularLast(3)->get(); // Get popular posts on the last 3 days

Posts::popularDay()->get(); // Get posts ordered by the most visited on the last 24h
Posts::popularWeek()->get();
Posts::popularMonth()->get();
Posts::popularYear()->get();
Posts::popularAllTime()->get();
```

Install
-------

[](#install)

Via Composer

```
$ composer require wanderreisen/laravel-popular
```

If you're on Laravel &lt;= 5.4 add `'Wanderreisen\LaravelPopular\LaravelPopularServiceProvider::class',` in your `config/app.php` to the end of the `$providers` array

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'Wanderreisen\LaravelPopular\LaravelPopularServiceProvider::class',

),
```

Now, let's create our table on the database:

```
$ php artisan migrate
```

We're ready!

Testing
-------

[](#testing)

There is no test setup yet, please pull request if you do it =)

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

[](#contributing)

Feel free to Pull Request anytime!

Author
------

[](#author)

- [Jordan Miguel](https://www.linkedin.com/in/joordanmiguel/)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 59.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

Every ~188 days

Recently: every ~282 days

Total

7

Last Release

2048d ago

PHP version history (2 changes)v1.0.0PHP ~5.6|~7.0

1.0.5PHP ~5.6|~7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5720659?v=4)[kknopp](/maintainers/kknopp)[@kknopp](https://github.com/kknopp)

---

Top Contributors

[![jordanmiguel](https://avatars.githubusercontent.com/u/8248858?v=4)](https://github.com/jordanmiguel "jordanmiguel (19 commits)")[![konstantinknopp](https://avatars.githubusercontent.com/u/20162962?v=4)](https://github.com/konstantinknopp "konstantinknopp (6 commits)")[![oliuz](https://avatars.githubusercontent.com/u/5214293?v=4)](https://github.com/oliuz "oliuz (3 commits)")[![Xoshbin](https://avatars.githubusercontent.com/u/1606070?v=4)](https://github.com/Xoshbin "Xoshbin (2 commits)")[![thatleeguy](https://avatars.githubusercontent.com/u/93346?v=4)](https://github.com/thatleeguy "thatleeguy (1 commits)")[![thylerz](https://avatars.githubusercontent.com/u/94443476?v=4)](https://github.com/thylerz "thylerz (1 commits)")

---

Tags

laravelpopularJordanMiguellaravel-popular

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/wanderreisen-laravel-popular/health.svg)

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

###  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)[jordanmiguel/laravel-popular

A Laravel package to track popularity of entries(by Models) in a website at a certain time.

659.6k1](/packages/jordanmiguel-laravel-popular)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)[xefi/faker-php-laravel

Faker php integration with laravel

1915.1k](/packages/xefi-faker-php-laravel)[dcblogdev/laravel-junie

Install pre-configured guides for Jetbrains Junie

392.5k](/packages/dcblogdev-laravel-junie)

PHPackages © 2026

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