teraone/matomo-client
最新稳定版本:v1.2.1
Composer 安装命令:
composer require teraone/matomo-client
包简介
A Matomo API Client Library for Laravel
README 文档
README
This package is based on VisualAppeal/Matomo-PHP-API
Installation
You can install the package via composer:
composer require teraone/matomo-client
Publish and edit the configuration file
php artisan vendor:publish
- Choose
matomo-client - Update the file
app/config/matomo-client.phpwith your Matomo credentials
Usage
To keep things simple, only JSON is supported.
All Methods return a Illuminate\Http\Client\Response
// get the Matomo Client $matomoClient = app()->get('matomo-client'); // get Visits of this month $matomo->setDate(now(), MatomoClient::PERIOD_MONTH) ->setFilterLimit(10) // defaults to 100 ->getVisits() ->json(); // get Event Names of the last week $matomo->setDate(now()->subWeek(), MatomoClient::PERIOD_RANGE, now()) ->getEventName() ->json();
Testing
Under the hood this library uses the Laravel HTTP Client.
You can mock all Requests in your tests
Http::fake( 'https://matomo.test/index.php*' => \Http::response(['value' => 123], 200), );
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email gotre@teraone.de instead of using the issue tracker.
Credits
- VisualAppeal
- All Contributors
- This package was generated using the Laravel Package Boilerplate.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 15.8k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-20