Connect your Kiyoh to your Laravel application

v1.2.1 2022-04-12 16:40 UTC



Laravel Kiyoh Reviews

Latest Version on Packagist Total Downloads License Stars Forks


You can install this package using composer.

composer require marshmallow/reviews-kiyoh


To start using Kiyoh you need to publish the config and update the config accordingly. You need to add hash, location_id and feed_hash to config/kiyoh.php.

php artisan vendor:publish --provider="Marshmallow\Reviews\Kiyoh\ServiceProvider"


use Marshmallow\Reviews\Kiyoh\Facades\KiyohInvite;
use Marshmallow\Reviews\Kiyoh\Exceptions\KiyohException;

try {

                 * Optional
                ->lastName('van Esch')
                ->refCode('Order: #1001')
                ->city('Alphen aan den Rijn')


                 * Always end with invite()

} catch (KiyohException $e) {
     * You should always try-catch this. Kiyoh can
     * through an error if someone has already received
     * an invitation. If this is thrown, you don't want
     * you code to be killed!

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 exeption 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.

use Marshmallow\Reviews\Kiyoh\Facades\Kiyoh;


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 you own database or do whatever with it, you can get them with the methods below:

$reviews = Kiyoh::withoutCache()->feed();
foreach ($reviews as $review) {
    // Do your own magic here


php artisan marshmallow:resource KiyohProduct Reviews\Kiyoh

Copyright (c) 2020 marshmallow.


The MIT License (MIT). Please see License File for more information.

Tests during development

php artisan test packages/marshmallow/reviews/kiyoh