定制 ssebetta/larnalytics 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ssebetta/larnalytics

最新稳定版本:1.0.6

Composer 安装命令:

composer require ssebetta/larnalytics

包简介

A simple web analytics tool for laravel projects

README 文档

README

Larnalytics is a simple site analytics package for Laravel applications.

Installation

  1. Require the package using Composer:

    composer require ssebetta/larnalytics
  2. Publish the package's configuration and migration files:

    php artisan vendor:publish --provider="Ssebetta\Larnalytics\Providers\LarnalyticsServiceProvider"
  3. Run the migrations to create the necessary database tables:

    php artisan migrate
  4. Register the middleware in your app/Http/Kernel.php file:

    protected $middlewareGroups = [
        'web' => [
            // ...
            \Ssebetta\Larnalytics\Http\Middleware\TrackPageViews::class,
        ],
    ];

Extra

Run php artisan route:cache to access the analytics/page-views route

Usage

Larnalytics will automatically track page views and store the data in the page_views table.

Use your-site-url/analytics/page-views to access the frontend view.

You can log custom events using the Analytics helper:

use Ssebetta\Larnalytics\Helpers\Analytics;

Analytics::logEvent('event_name', ['key' => 'value']);

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-09