kitoko/visitor-tracker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kitoko/visitor-tracker

最新稳定版本:v1.0.1

Composer 安装命令:

composer require kitoko/visitor-tracker

包简介

A package for tracking visitor on your laravel web site or web application

README 文档

README

A simple and flexible Laravel package to track website visitors and page visits.

1. Installation

composer require kitoko/visitor-tracker

2. Publish the configuration file:

php artisan vendor:publish --tag=visitor-tracker-config

This command will generate

config/visitor-tracker.php

3. Run migration to create the required tables:

php artisan migrate

Confuguration

Edit config/visitor-tracker.php to customize your settings, for example:

return [
    'enabled' => true,
    'retention_days' => 30,
    'cache_minutes' => 10,
];
  • enable is true by default
  • retention_days is how long yo want to conserve your data (It is 1 month by default)
  • cache minites is the time you want to keep data in cache

Usage

Once installed, the package will automatically track visitors and page views. You can display visitor statistics in your application using the provided services or helpers.

Display statistics in blade

<div>
    Total visitors: {{ \Kitoko\VisitorTracker\Facades\VisitorTracker::total() }}
    Today: {{ \Kitoko\VisitorTracker\Facades\VisitorTracker::today() }}
    Yesterday: {{ \Kitoko\VisitorTracker\Facades\VisitorTracker::yesterday() }}
</div>

Using in a controller

use Kitoko\VisitorTracker\Facades\VisitorTracker;

public function index()
{
    $stats = [
        'total' => VisitorTracker::total(),
        'today' => VisitorTracker::today(),
        'week'  => VisitorTracker::week(),
    ];

    return view('dashboard', compact('stats'));
}

Features

  • Track unique visitors
  • Track page visits
  • Daily, weekly, and monthly statistics
  • Total visitor counter
  • Easy integration with Laravel

Requirements

  • PHP ^8.0
  • Laravel ^9 | ^10 | ^11 | ^12

Troubleshooting

  • Class not found
composer dump-autoload 
  • Migrations not working? Ensure your VisitorTrackerServiceProvider has:
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固