Download the PHP package marshmallow/reviews-kiyoh without Composer
On this page you can find all versions of the php package marshmallow/reviews-kiyoh. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download marshmallow/reviews-kiyoh
More information about marshmallow/reviews-kiyoh
Files in marshmallow/reviews-kiyoh
Package reviews-kiyoh
Short Description Connect your Kiyoh to your Laravel application
License MIT
Homepage https://github.com/Marshmallow-Development/
Informations about the package reviews-kiyoh
Laravel Kiyoh Reviews
Connect your Kiyoh account to your Laravel application. Send review invitations, pull your aggregated feed (average score, review count, recommendation), and optionally store reviews in your own database.
Installation
You can install this package using composer.
The service provider is auto-discovered. The Kiyoh, KiyohInvite and KiyohProduct facades are registered automatically.
Setup
To start using Kiyoh you need to publish the config and update it accordingly. At a minimum you need to add hash, location_id and feed_hash to config/kiyoh.php (or set the matching environment variables).
Configuration
All keys live in config/kiyoh.php. The most common values can be set through environment variables:
| Config key | Env variable | Default | Description |
|---|---|---|---|
hash |
KIYOH_INVITE_HASH |
null |
Hash used to authenticate review invitations. |
location_id |
KIYOH_LOCATION_ID |
null |
Your Kiyoh location id. |
language |
KIYOH_LANGUAGE |
nl |
Language used for invitations. |
delay |
KIYOH_INVITE_DELAY_IN_DAYS |
3 |
Default delay (in days) before an invitation is sent. |
feed_hash |
KIYOH_FEED_HASH |
null |
Hash used to read the public review feed. |
cache_feed_in_seconds |
KIYOH_FEED_CACHE_TTL |
3600 |
How long the feed is cached, in seconds. |
cache_name |
KIYOH_FEED_CACHE_NAME |
kiyoh_reviews_object |
Cache key under which the feed is stored. |
publication_api_token |
KIYOH_PUBLICATION_API_TOKEN |
null |
API token used for product publication endpoints. |
models.product |
— | Marshmallow\Reviews\Kiyoh\Models\KiyohProduct |
Model used to represent a Kiyoh product. |
The invite_path, review_path, product_path and product_review_path keys hold the Kiyoh API endpoints and normally do not need to be changed.
Invites
Feed aggregate information
Using feed information is very easy. Use the Kiyoh facade to access feed data. Available methods are listed below. Please note that by default the XML feed of Kiyoh will be cached using your default CACHE_DRIVER. The feed will be cached for 1 hour. You can change this in config/kiyoh.php. If for some reason the feed is unavailable an exception will be thrown. If you are using these methods in blade you can prefix the methods with dontFail(). If you use dontFail() all methods will return 0.
Available methods
- Kiyoh::feed()->average()
- Kiyoh::feed()->count()
- Kiyoh::feed()->average12months()
- Kiyoh::feed()->count12months()
-
Kiyoh::feed()->recommendation()
- Kiyoh::feed()->getAttribute('average')
Store the reviews in your own database
If you wish to get all the reviews and store them in your own database or do whatever with it, you can get them with the methods below:
The package also ships an artisan command that loads the uncached feed for you, ready to be extended with your own persistence logic:
Products
Tests during development
Credits
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see the License File for more information.
Copyright (c) 2020 marshmallow.
