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

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

zepson/laravel-popular
======================

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

8.1(5y ago)010MITPHPPHP ~5.6|~7.2

Since Sep 1Pushed 5y agoCompare

[ Source](https://github.com/pro-cms/laravel-popular)[ Packagist](https://packagist.org/packages/zepson/laravel-popular)[ RSS](/packages/zepson-laravel-popular/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (9)Used By (0)

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

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/0e0af7fc54714cff2b9531286b0c393e07c6c2f71f7952400dbb0531ed04f671/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f7264616e6d696775656c2f6c61726176656c2d706f70756c61722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jordanmiguel/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 \JordanMiguel\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 jordanmiguel/laravel-popular
```

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

```
'providers' => array(

    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    ...
    'JordanMiguel\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

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 67.7% 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 ~181 days

Recently: every ~315 days

Total

8

Last Release

1906d ago

Major Versions

1.0.6 → 8.12021-02-21

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

1.0.5PHP ~5.6|~7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0106b85cb7795defc0d17a630c94a97e9f9e33c6e8e433fe2bc340f40f444bc5?d=identicon)[zepson](/maintainers/zepson)

---

Top Contributors

[![jordanmiguel](https://avatars.githubusercontent.com/u/8248858?v=4)](https://github.com/jordanmiguel "jordanmiguel (21 commits)")[![oliuz](https://avatars.githubusercontent.com/u/5214293?v=4)](https://github.com/oliuz "oliuz (3 commits)")[![pro-cms](https://avatars.githubusercontent.com/u/57701433?v=4)](https://github.com/pro-cms "pro-cms (2 commits)")[![Xoshbin](https://avatars.githubusercontent.com/u/1606070?v=4)](https://github.com/Xoshbin "Xoshbin (2 commits)")[![smayzes](https://avatars.githubusercontent.com/u/187110?v=4)](https://github.com/smayzes "smayzes (1 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/zepson-laravel-popular/health.svg)

```
[![Health](https://phpackages.com/badges/zepson-laravel-popular/health.svg)](https://phpackages.com/packages/zepson-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)
