PHPackages                             srdev93/visitlog - 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. srdev93/visitlog

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

srdev93/visitlog
================

Laravel package to log visitor information into database.

2.0.0(1y ago)133MITPHPPHP &gt;=7.0|&gt;=8.0

Since Jul 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/SrDev93/visitlog)[ Packagist](https://packagist.org/packages/srdev93/visitlog)[ RSS](/packages/srdev93-visitlog/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Laravel VisitLog
================

[](#laravel-visitlog)

Introduction
------------

[](#introduction)

VisitLog is a simple Laravel 5 package that can be used to log visitor information and save it into database.

Features
--------

[](#features)

- Other than basic log such as IP, Browser and OS, it can also log Location information.
- Allows to log both unique and non-unique visits based on IP.
- Allows to cache the visits based on IP.
- Allows to log authenticated user info.
- Provides log viewer page out of box.
- Provides basic http authentication for app users.
- Ability to ban users by their IP

**Note:** VisitLog cannot detect same user/IP coming from some anonymizer so it cannot differentiate that.

Screenshot
----------

[](#screenshot)

[![Main Window](https://camo.githubusercontent.com/fb0acc55768d36fdc7a833c09a112a9fdafaf9d1085f7fb3f062b84f92d9bf55/68747470733a2f2f7261772e6769746875622e636f6d2f737264657639332f76697369746c6f672f6d61737465722f73637265656e2e706e67)](https://camo.githubusercontent.com/fb0acc55768d36fdc7a833c09a112a9fdafaf9d1085f7fb3f062b84f92d9bf55/68747470733a2f2f7261772e6769746875622e636f6d2f737264657639332f76697369746c6f672f6d61737465722f73637265656e2e706e67)

*Note: Info in above screenshot is fake.*

Requirements
------------

[](#requirements)

- PHP &gt;= 5.5.9
- Laravel 5

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

[](#installation)

Install via composer

```
composer require srdev93/visitlog

```

For Laravel &lt; 5.5:

Add Service Provider to `config/app.php` in `providers` section

```
SrDev93\VisitLog\VisitLogServiceProvider::class,
```

Add Facade to `config/app.php` in `aliases` section

```
'VisitLog' => SrDev93\VisitLog\Facades\VisitLog::class,
```

---

Run `php artisan vendor:publish` to publish package's config and migration file. You should now have `config/visitlog.php` file published. It will also publish migration file in `database/migrations` folder.

Run `php artisan migrate` to create `visitlogs` table in your database.

Config Options
--------------

[](#config-options)

- `route` : Route where visit log will be available.
- `iptolocation` : By default, only IP, Browser and OS info is logged. However if you set this option to `true`, it will also log Location info through  service.
- `cache` : If `iptolocation` is set to `true`, this option can be used to cache the results instead of requesting Location info each time from .
- `unique` : If `true`, it will only log unique visits based on IP address. If `false`, it will log each visit even from same IP.
- `log_user` : If `true`, it will also log authenticated user info.
- `user_name_fields` : If `log_user` is `true`, this option can be used to specify name fields of user from your Users table in database.
- `visitlog_page` : If `true`, a default log viewer page can be viewed at `http//yourapp.com/your_route` to see all the logs. Here `your_route` is the first option above.
- `http_authentication` : If `visitlog_page` is `true`, this option can be used to show visit log page to only authenticated app users by asking them email and password via basic http authentication.

Saving Log Info
---------------

[](#saving-log-info)

To save logs, just call `save` method of `VisitLog` facade: `VisitLog::save();`

**Tip:** If you want to save only unique logs based on IP, login or post-login page is good place to use the `save` method on because generally login page isn't visited again after user is authenticated. If you also want to save authenticated user, calling `save` method inside login post method seems to be good idea.

If however, you have set `unique` option to `false` and want to log all visits, calling `save` method in common location is good idea like base controller of your app.

Viewing Log Info
----------------

[](#viewing-log-info)

If config option `visitlog_page` is set to `true`, you can view all visit logs by browsing to `http//yourapp.com/your_route`.

**Note:** If you don't want to allow `visitlog` page to be publicly seen, set the option `visitlog_page` to `false` and now `http//yourapp.com/your_route` will result in `404` error.

In this case, you can still show log info in some authenticated area of your app by using `all` method of `VisitLog` facade: `$visitLogs = VisitLog::all();` and it will give you `Collection` that you can iterate over and show in your own view file.

License
-------

[](#license)

This code is published under the [MIT License](http://opensource.org/licenses/MIT). This means you can do almost anything with it, as long as the copyright notice and the accompanying license file is left intact.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~224 days

Total

3

Last Release

620d ago

Major Versions

1.0.11 → 2.0.02024-10-20

PHP version history (2 changes)1.0.0PHP &gt;=7.0

1.0.11PHP &gt;=7.0|&gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38728381?v=4)[Sajad Rahmani](/maintainers/SrDev93)[@SrDev93](https://github.com/SrDev93)

---

Top Contributors

[![SrDev93](https://avatars.githubusercontent.com/u/38728381?v=4)](https://github.com/SrDev93 "SrDev93 (5 commits)")

---

Tags

loglaravelIPvisitor

### Embed Badge

![Health badge](/badges/srdev93-visitlog/health.svg)

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

###  Alternatives

[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k127.1M202](/packages/sentry-sentry-laravel)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M164](/packages/spatie-laravel-health)[larabug/larabug

Laravel 6.x/7.x/8.x/9.x/10.x/11.x/12.x/13.x bug notifier

299582.7k1](/packages/larabug-larabug)[sarfraznawaz2005/visitlog

Laravel package to log visitor information into database.

8817.1k](/packages/sarfraznawaz2005-visitlog)[masterro/laravel-mail-viewer

Easily view in browser outgoing emails.

65108.9k](/packages/masterro-laravel-mail-viewer)[spatie/laravel-flare

Send Laravel errors to Flare

111.4M7](/packages/spatie-laravel-flare)

PHPackages © 2026

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