Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Visitlog Laravel Package

sarfraznawaz2005/visitlog

Laravel package for logging and analyzing website visits. It records page views with visitor details like IP, browser, OS, device, referrer, and country, supports route exclusions via middleware, and helps track unique visitors, online users, and traffic stats.

View on GitHub
Deep Wiki
Context7

Laravel package to log visitor information into database.

Frequently asked questions about Visitlog
How do I install sarfraznawaz2005/visitlog in a Laravel application?
Install it with composer require sarfraznawaz2005/visitlog, then publish the package assets (config and migration) using php artisan vendor:publish and run php artisan migrate. The service provider is auto-discovered, so there are no container bindings to wire up. Finally, register the visitlog middleware on the route groups you actually want to observe. The only infrastructure it needs is your existing database connection.
Which Laravel versions does visitlog 6.0.0 support?
Version 6.0.0 is a compatibility-only major release that adds Laravel 13.x support; by Laravel package convention that means the illuminate/* constraints were raised and older framework majors such as 11.x and 12.x were dropped. If your application is still on Laravel 12.x you should stay pinned to visitlog 5.0.0 and freeze the package until the framework moves. Check the exact require constraint in the package composer.json before you plan the upgrade, because 6.0.0 will not resolve on older Laravel versions.
What visitor information does visitlog record for each page view?
Each logged visit stores page view data along with visitor details such as IP address, browser, operating system, device type, referrer and country. Records are written to a database table created by the package migration, which is what powers the unique visitor, online user and traffic statistics. Because IP and user agent are captured, treat the table as containing personal data.
How do I exclude certain routes or pages from being logged?
Exclusion works primarily through the middleware: visitlog logs requests only on the route groups where you attach its middleware, so keeping it off admin, API or health-check groups is the simplest control. The published config also holds the package's route exclusion options, so review that file after publishing and add the paths you want to skip. Bots and authenticated-user filtering should be confirmed against the config keys in the version you install rather than assumed.
Does visitlog track unique visitors and currently online users?
Yes. The package is designed to help you track unique visitors, users currently online and general traffic statistics on top of the raw page-view records. Those numbers are derived from the visit rows in your database, so accuracy depends on how broadly you apply the middleware. If you only instrument some route groups, your stats will only reflect that subset of traffic.
Will visitlog slow down my Laravel application on high-traffic routes?
Visit logging is a per-request database insert in the request lifecycle, so on busy routes it adds latency and write amplification proportional to your traffic. Keep the middleware scoped to the route groups you truly need to measure, and consider queueing or sampling if you are logging every request on high-volume endpoints. Also confirm whether write failures are swallowed (fail-open) or allowed to bubble up, since a fail-closed logger could turn a database hiccup into 500 responses.
How do I upgrade from visitlog 5.0.0 to 6.0.0 safely?
Treat it as a coupled upgrade rather than a package-only bump: land the Laravel 13 framework upgrade first or in the same branch, then change the constraint to ^6.0 in that same change set. A standalone visitlog bump on Laravel 12.x will simply fail Composer resolution. Diff the published config and migration between 5.0.0 and 6.0.0; if the migration is unchanged no data migration is needed, and if it changed you need a documented upgrade step. No functional API changes were announced in 6.0.0, so the risk is mostly in the version boundary.
Does visitlog handle GDPR, CCPA, IP anonymization and data retention?
The package does not ship a compliance or retention policy for you; it captures IP addresses, user agents and referrers, which are personal data in many jurisdictions. Your team must decide the lawful basis, retention window and anonymization approach, and check the published config for any IP anonymization option in your installed version before rolling it out. In practice that means adding a cleanup job and documenting the purpose of the data collection.
How do I prune or delete old visit records?
There is no documented built-in pruning command, so plan on owning a scheduled cleanup job against the visits table, for example deleting or chunk-deleting rows older than your retention window in a queued or nightly task. Verify whether your installed version ships any prune command or config option before writing your own. Keeping the table small also protects the dashboard and stats queries from slowing down over time.
Is visitlog actively maintained, and what are the risks of depending on it?
It is a small single-maintainer package without commercial support, and its major versions now track Laravel majors, which means every future Laravel upgrade is gated on the maintainer shipping a matching release. The mitigating factor is the small code surface: a service provider, a middleware, a config file, a migration and one table, which is realistically forkable if upstream stalls. Scope the middleware narrowly and pin the version so an unexpected release cannot break your upgrade path.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core