PHPackages                             karrarjasim/laravel-visites - 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. karrarjasim/laravel-visites

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

karrarjasim/laravel-visites
===========================

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

0240PHP

Since Nov 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/karrarjasim/laravel-visites)[ Packagist](https://packagist.org/packages/karrarjasim/laravel-visites)[ RSS](/packages/karrarjasim-laravel-visites/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)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

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/30331385?v=4)[karrar jasim](/maintainers/karrarjasim)[@karrarjasim](https://github.com/karrarjasim)

---

Top Contributors

[![karrarjasim](https://avatars.githubusercontent.com/u/30331385?v=4)](https://github.com/karrarjasim "karrarjasim (1 commits)")

### Embed Badge

![Health badge](/badges/karrarjasim-laravel-visites/health.svg)

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

PHPackages © 2026

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