ismaelillodev / fathom-analytics
这是我开发的 fathom-analytics 包
dev-main
2024-04-15 19:34 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.2
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- larastan/larastan: ^2.0.1
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.8
- pestphp/pest: ^2.20
- pestphp/pest-plugin-arch: ^2.5
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-09-08 20:01:52 UTC
README
此包目前正在开发中。任何建议都备受欢迎!
安装
使用 composer 安装此包
composer require ismaelillodev/fathom-analytics:dev-main
使用以下命令发布配置文件
php artisan vendor:publish --tag="fathom-analytics-config"
将 FATHOM_ACCESS_TOKEN 变量添加到您的 .env 文件中
用法
use Ismaelillodev\FathomAnalytics\DTO\Aggregation; use Ismaelillodev\FathomAnalytics\FathomAnalytics; public function __construct( private FathomAnalytics $fathomAnalytics ){} public function handle() { $response = $this->fathomAnalytics->aggregations( new Aggregation( entity: 'pageview', entity_id: 'your_site_id', aggregates: 'uniques', field_grouping: 'hostname,pathname' )); //do something awesome with the response! }
当前功能
如果您对如何制作特定请求有任何疑问,可以访问 API 文档(https://usefathom.com/api)。
聚合
调用聚合函数并传递一个聚合 DTO。
$this->fathomAnalytics->aggregations( new Aggregation( entity: 'pageview', entity_id: 'your_site_id', aggregates: 'visits', ));
变更日志
请参阅 CHANGELOG 了解最近更改的详细信息。
贡献
请参阅 CONTRIBUTING 了解详细信息。
安全漏洞
请查阅 我们的安全策略 了解如何报告安全漏洞。
鸣谢
许可协议
MIT 许可协议(MIT)。请参阅 许可文件 了解更多信息。