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
-
Require the package using Composer:
composer require ssebetta/larnalytics
-
Publish the package's configuration and migration files:
php artisan vendor:publish --provider="Ssebetta\Larnalytics\Providers\LarnalyticsServiceProvider" -
Run the migrations to create the necessary database tables:
php artisan migrate
-
Register the middleware in your
app/Http/Kernel.phpfile: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
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-09