minabeter/analyze-website 问题修复 & 功能扩展

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

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

minabeter/analyze-website

Composer 安装命令:

composer require minabeter/analyze-website

包简介

Website analytics package for Laravel and Filament

README 文档

README

Quick Summary

This package helps in tracking and analyzing website visits. It records information about each visit, such as the visited page, visitor information, and the browser used.

Installation

You can install the package via composer:

composer require minabeter/analyze-website
run php artisan migrate

Publish the config file with:

php artisan vendor:publish --tag=analyze-website-config

This will create a config/analyze-website.php file in your project.

Usage

To set up the package correctly, please follow these steps:

  1. Add Service Provider: In your bootstrap/providers.php file, add the following line after AppServiceProvider::class:

    Mina\AnalyzeWebsite\AnalyzeWebsiteServiceProvider::class,
  2. Add Middleware: In your bootstrap/app.php file, within the web middleware group, add TrackVisit::class:

    ->withMiddleware(function (Middleware $middleware): void {
        $middleware->web(append: [
            \Mina\AnalyzeWebsite\Middleware\TrackVisit::class,
            // ... other middleware
        ]);
    })
  3. Configure Driver: In your .env file, add the following to specify the driver for analytics. You can choose between database, queue, or redis.

    ANALYTICS_DRIVER=database
    • database: (Default) Saves visit data directly to the database.
    • queue: Pushes visit data to a queue for background processing. Make sure your queue worker is running.
    • redis: Caches visit data in Redis for high performance.
  4. Redis Driver Setup: If you choose to use the redis driver, you need to schedule a command to flush the cached data to the database periodically.

    In your app/Console/Kernel.php, add the following to the schedule method:

    $schedule->command('analytics:flush')->everyMinute();
  5. Filament Integration: To display the analytics dashboard in your Filament admin panel, you need to add the AnalyzeWebsitePlugin to your panel provider.

    In your panel provider file (e.g., app/Providers/Filament/AdminPanelProvider.php), add the following to the plugins method:

    ->plugins([
        \Mina\AnalyzeWebsite\Filament\AnalyzeWebsitePlugin::make()
    ])

    This will add the analytics page to your Filament admin panel, where you can view the collected data.

    Analytics Dashboard Top Pages and Referrers

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固