nowendwell/app-analytics
最新稳定版本:0.2.1
Composer 安装命令:
composer require nowendwell/app-analytics
包简介
Track your Laravel application usage
README 文档
README
Track usage analytics for your Laravel application.
Installation
You can install the package via composer:
composer require nowendwell/app-analytics
You can publish the config file with:
php artisan vendor:publish --tag="app-analytics-config"
You can publish and run the migrations with:
php artisan vendor:publish --tag="app-analytics-migrations"
php artisan migrate
Usage
Simply add the included middleware \Nowendwell\AppAnalytics\Middleware\TrackAnalyticsMiddleware to your Http Kernel middleware list and let the package do the rest.
protected $middlewareGroups = [ 'web' => [ // ... \Nowendwell\AppAnalytics\Middleware\TrackAnalyticsMiddleware::class, ],
If you want to keep track of your own custom events, outside of the default page view tracking, you can use the TrackEvent facade.
use Nowendwell\AppAnalytics\Facades\AppAnalytics; class InvoicePaymentController extends Controller { public function store(Invoice $invoice): RedirectResponse { // Track a custom event AppAnalytics::event('Invoice Paid', ['invoice_id' => 123, 'amount' => 1000]); return response()->redirect(route('invoices.show', $invoice)); } }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 65
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-19