PHPackages                             wikigods/jraty - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. wikigods/jraty

ActiveLibrary

wikigods/jraty
==============

Package for item ratings + optional microdata format.

1.0.1(4y ago)022MITPHP

Since Feb 14Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wikigods/jraty)[ Packagist](https://packagist.org/packages/wikigods/jraty)[ Docs](http://github.com/wikigods/jraty)[ RSS](/packages/wikigods-jraty/feed)WikiDiscussions master Synced today

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Laravel 8 Rating Package
========================

[](#laravel-8-rating-package)

Rating Package using jQuery Raty plugin for item ratings + optional microdata format.

[![alt text](https://camo.githubusercontent.com/2b814b5a2b82e2996bcdcd6ade90f743ef485fa04211becaa4980852c888058c/68747470733a2f2f692e696d6775722e636f6d2f3448376a7755622e706e67 "1")](https://camo.githubusercontent.com/2b814b5a2b82e2996bcdcd6ade90f743ef485fa04211becaa4980852c888058c/68747470733a2f2f692e696d6775722e636f6d2f3448376a7755622e706e67)[![alt text](https://camo.githubusercontent.com/a5aee4a68664b5c68e4b742e8583c6b56ba2b111a2654e41d4ff6540d6a28693/68747470733a2f2f692e696d6775722e636f6d2f575462616e336d2e706e67 "2")](https://camo.githubusercontent.com/a5aee4a68664b5c68e4b742e8583c6b56ba2b111a2654e41d4ff6540d6a28693/68747470733a2f2f692e696d6775722e636f6d2f575462616e336d2e706e67)[![alt text](https://camo.githubusercontent.com/0703b86652541ecad14e268057213f7ba814223a039d3394b42c34a93f4e2e28/68747470733a2f2f692e696d6775722e636f6d2f3779504e37594c2e706e67 "3")](https://camo.githubusercontent.com/0703b86652541ecad14e268057213f7ba814223a039d3394b42c34a93f4e2e28/68747470733a2f2f692e696d6775722e636f6d2f3779504e37594c2e706e67)[![alt text](https://camo.githubusercontent.com/ba5d0e5d01a75f5f186a127510b529c396c76322d897b57ef62c72b02cc2a085/68747470733a2f2f692e696d6775722e636f6d2f6f6c396137394d2e706e67 "4")](https://camo.githubusercontent.com/ba5d0e5d01a75f5f186a127510b529c396c76322d897b57ef62c72b02cc2a085/68747470733a2f2f692e696d6775722e636f6d2f6f6c396137394d2e706e67)[![alt text](https://camo.githubusercontent.com/a0eecdd21a7f1ff2967c8349a5885b9159540ee1d316116001c48fb427ae92db/68747470733a2f2f692e696d6775722e636f6d2f687865557150462e706e67 "5")](https://camo.githubusercontent.com/a0eecdd21a7f1ff2967c8349a5885b9159540ee1d316116001c48fb427ae92db/68747470733a2f2f692e696d6775722e636f6d2f687865557150462e706e67)

The package is doing everything for you - from displaying rating to receiving rating and stores it into database.

This package is a re-edited, reorganized and maintained version of escapeboy/jraty, which is no longer maintained.

---

Installation
============

[](#installation)

Require this package with composer:

```
composer require wikigods/jraty

```

`The service provider will be auto-discovered. You do not need to add the provider anywhere.`

Configuration To use your own settings, publish config.

```
php artisan vendor:publish --provider="Wikigods\Jraty\JratyServiceProvider"

```

Config file `config/jraty.php` should like this

```
return [
    'route' => 'save/item_rating'
];

```

Prepare for usage
=================

[](#prepare-for-usage)

First you need to load jQuery

```

```

then need to load Raty plugin. You can use it like this:

```
echo Jraty::js()
```

or

```

```

After we need to initialize Raty plugin.

Using library:

```
echo Jraty::js_init($params=[]);
```

Jraty::js\_init accepts array with options for Raty. More info can be found on [Raty website](http://wbotelhos.com/raty)

For example this and it is default:

```
Jraty::js_init([
    'score' => 'function() { return $(this).attr(\'data-score\'); }',
    'number' => 5,
    'click' => 'function(score, evt) {
                $.post(\'save/item_rating\',{
                    item_id: $(\'[data-item]\').attr(\'data-item\'),
                    score: score
                });
              }',
    'path' => '\'vendor/wikigods/jraty/img\''
]);
```

returns

```
$(document).ready(function () {
    $('#item-rating').raty({
        'score': function () {
            return $(this).attr('data-score');
        },
        'number': 5,
        'click': function (score, evt) {
            $.post('save/item_rating', {
                item_id: $('[data-item]').attr('data-item'),
                score: score
            });
        },
        'path': 'vendor/wikigods/jraty/img'
    });
});
```

**Important:** If you noticed in php call single quotes are escaped.

Usage
=====

[](#usage)

```
echo Jraty::html($item_id, $item_name='', $item_photo='', $seo=true);
```

*If you are using seo option (true by default) its good to set a item\_name*

And result will be [![alt text](https://camo.githubusercontent.com/2b814b5a2b82e2996bcdcd6ade90f743ef485fa04211becaa4980852c888058c/68747470733a2f2f692e696d6775722e636f6d2f3448376a7755622e706e67 "1")](https://camo.githubusercontent.com/2b814b5a2b82e2996bcdcd6ade90f743ef485fa04211becaa4980852c888058c/68747470733a2f2f692e696d6775722e636f6d2f3448376a7755622e706e67)[![alt text](https://camo.githubusercontent.com/a5aee4a68664b5c68e4b742e8583c6b56ba2b111a2654e41d4ff6540d6a28693/68747470733a2f2f692e696d6775722e636f6d2f575462616e336d2e706e67 "2")](https://camo.githubusercontent.com/a5aee4a68664b5c68e4b742e8583c6b56ba2b111a2654e41d4ff6540d6a28693/68747470733a2f2f692e696d6775722e636f6d2f575462616e336d2e706e67)[![alt text](https://camo.githubusercontent.com/0703b86652541ecad14e268057213f7ba814223a039d3394b42c34a93f4e2e28/68747470733a2f2f692e696d6775722e636f6d2f3779504e37594c2e706e67 "3")](https://camo.githubusercontent.com/0703b86652541ecad14e268057213f7ba814223a039d3394b42c34a93f4e2e28/68747470733a2f2f692e696d6775722e636f6d2f3779504e37594c2e706e67)[![alt text](https://camo.githubusercontent.com/ba5d0e5d01a75f5f186a127510b529c396c76322d897b57ef62c72b02cc2a085/68747470733a2f2f692e696d6775722e636f6d2f6f6c396137394d2e706e67 "4")](https://camo.githubusercontent.com/ba5d0e5d01a75f5f186a127510b529c396c76322d897b57ef62c72b02cc2a085/68747470733a2f2f692e696d6775722e636f6d2f6f6c396137394d2e706e67)[![alt text](https://camo.githubusercontent.com/a0eecdd21a7f1ff2967c8349a5885b9159540ee1d316116001c48fb427ae92db/68747470733a2f2f692e696d6775722e636f6d2f687865557150462e706e67 "5")](https://camo.githubusercontent.com/a0eecdd21a7f1ff2967c8349a5885b9159540ee1d316116001c48fb427ae92db/68747470733a2f2f692e696d6775722e636f6d2f687865557150462e706e67)

*Library is accepting only one rating per item from single IP.*

Additional
----------

[](#additional)

Deleting record

```
Jraty::delete($id)
```

Adding manual rating

```
$data = [
        'item_id'    => Request::get('item_id'),
        'score'      => Request::get('score'),
        'added_on'   => DB::raw('NOW()'),
        'ip_address' => Request::getClientIp()
		];
Jraty::add($data);
```

Getting rating data for item

```
$rating = Jraty::get($item_id);
echo $rating->avg; // avarage score
echo $rating->votes; // total votes
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~299 days

Total

2

Last Release

1611d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05957243423dd4461db11c7d619af44c50c3585964f9dd0da229122933b721a8?d=identicon)[Wikigods-JCSO](/maintainers/Wikigods-JCSO)

---

Top Contributors

[![wikigods](https://avatars.githubusercontent.com/u/71094046?v=4)](https://github.com/wikigods "wikigods (4 commits)")

---

Tags

laravelseoRatingmicrodatajraty

### Embed Badge

![Health badge](/badges/wikigods-jraty/health.svg)

```
[![Health](https://phpackages.com/badges/wikigods-jraty/health.svg)](https://phpackages.com/packages/wikigods-jraty)
```

###  Alternatives

[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[willvincent/laravel-rateable

Allows multiple models to be rated with a fivestar like system.

416452.0k3](/packages/willvincent-laravel-rateable)[fomvasss/laravel-meta-tags

A package to manage SEO (meta-tags, xml-fields, etc.)

3028.9k](/packages/fomvasss-laravel-meta-tags)[ycs77/inertia-laravel-ssr-head

Simple SSR Head for Inertia Laravel

3211.5k](/packages/ycs77-inertia-laravel-ssr-head)[3x1io/filament-sitemap

Site Settings Like title, description, profile and Sitemap Generator

152.2k](/packages/3x1io-filament-sitemap)[elegantly/laravel-seo

An Elegant &amp; flexible SEO tag builder for Laravel

122.9k](/packages/elegantly-laravel-seo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
