PHPackages                             fakhrani/visitor - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. fakhrani/visitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

fakhrani/visitor
================

log your visitors in db, page hits, and generate visit counter for Laravel 5

075PHP

Since Dec 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/MFakhrani/visitor)[ Packagist](https://packagist.org/packages/fakhrani/visitor)[ RSS](/packages/fakhrani-visitor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#Visitor
=========

[](#visitor)

### Installation

[](#installation)

The recommended way to install Visitor is through composer.

Step 1
------

[](#step-1)

run

```
composer require fakhrani/visitor
```

Step 2
------

[](#step-2)

Add if your laravel version is &lt; 5.5

```
	Fakhrani\Visitor\VisitorServiceProvider::class
```

to the list of service providers in app/config/app.php

Step 3
------

[](#step-3)

Migrate the Visitor Table Run

```
php artisan vendor:publish
```

then

```
php artisan migrate
```

to migrate visitor table

the config.php will be copied to /config at the same time

```
/config/visitor.php
```

costumize it accordinly

Step 5 (Optional)
-----------------

[](#step-5-optional)

Visit

download GeoLite2-City.mmdb

place it in (create the geo directory)

```
storage/geo/
```

or where ever you want just adjust the package config to reflect the new location, it's used to geo locate visitors

### Usage

[](#usage)

```
Visitor::log();   //log in db visitor ip, geo location, hit counter

Visitor::get();
Visitor::get( $ip );   //fetch ip record

Visitor::forget( $ip ); //delete ip from log

Visitor::has( $ip );   // checkk if visitor ip exist in log

Visitor::count()  // return count of all site registred unique visitors

Visitor::all();  // all records as array

Visitor::all(true);  // all records as collection

Visitor::clicks(); //total of all clicks

Visitor::range($date_start, $date_end); // visitors count in a date range;
```

\###Credits This product Uses GeoLite2 data created by MaxMind, whenever available.

Enjoy!

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity23

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/24287634?v=4)[fakhrani](/maintainers/fakhrani)[@fakhrani](https://github.com/fakhrani)

---

Top Contributors

[![fakhrani](https://avatars.githubusercontent.com/u/24287634?v=4)](https://github.com/fakhrani "fakhrani (2 commits)")

### Embed Badge

![Health badge](/badges/fakhrani-visitor/health.svg)

```
[![Health](https://phpackages.com/badges/fakhrani-visitor/health.svg)](https://phpackages.com/packages/fakhrani-visitor)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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