justbetter/statamic-feedback-company
Composer 安装命令:
composer require justbetter/statamic-feedback-company
包简介
Harvest FeedbackCompany reviews into a Statamic collection
README 文档
README
Statamic Feedback Company
Harvests reviews from Feedback Company using their API and saves them in a Statamic collection.
Installation
composer require justbetter/statamic-feedback-company
How to Use
- Set up the
FEEDBACKCOMPANY_CLIENT_IDandFEEDBACKCOMPANY_CLIENT_SECRETvalues in your.env - Publish the blueprints (see below), then create the
Reviewscollection &Reviewsglobal - Now you can harvest the reviews with
php artisan reviews:harvest
API
If you don't want to use the statamic API, this addon provides a basic API with which you can retrieve the harvested reviews by doing a GET request to the following endpoint:
/api/feedback-company
This will return the 3 newest reviews in the collection. Some other possibilities:
/api/feedback-company?page=1&count=5
/api/feedback-company?count=5&minscore=2&maxscore=5
ViewComposer
If you want to show some statistics about the reviews in your project, you can add the ReviewsComposer class as a viewcomposer to your specific component. You can add this in your serviceprovider:
View::composer('rapidez::layouts.footer', ReviewsComposer::class);
This will expose a $reviews variable to your blade component with a few useful statistics. For example:
Our customers give us a {{ $reviews['score'] }}/10 across {{ $reviews['count'] }} reviews.
{{ $reviews['percentage'] }}% of reviews recommend us.
You can also use $reviews['scores'][7] to display how many reviews have a 7/10 rating.
Tag
We integrated a Statamic Tag called Reviews which will allow you to get some basic data from the reviews like ratings and review content.
Blade example:
Statamic::tag('reviews:get_rating_data')->fetch();
Publishables
You can publish all of the publishables with:
php artisan vendor:publish --provider="JustBetter\StatamicFeedbackCompany\ServiceProvider"
Or publish them individually by using tags:
php artisan vendor:publish --provider="JustBetter\StatamicFeedbackCompany\ServiceProvider" --tag="blueprints" php artisan vendor:publish --provider="JustBetter\StatamicFeedbackCompany\ServiceProvider" --tag="config"
justbetter/statamic-feedback-company 适用场景与选型建议
justbetter/statamic-feedback-company 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 828 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 justbetter/statamic-feedback-company 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 justbetter/statamic-feedback-company 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 828
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-05-09