renoki-co / rating Goto Github PK
View Code? Open in Web Editor NEWLaravel Eloquent Rating allows you to assign ratings to any model.
License: Apache License 2.0
Laravel Eloquent Rating allows you to assign ratings to any model.
License: Apache License 2.0
Hello,
$page = Page::find(1);
$user->rate($page, 10);
\Rennokki\Rating\Models\RaterModel::first(); //created_at: null and updated_at: null,
Thanks,
Hello,
Can you, please, advice on what will be the best way to sort a model collection by rating?
Thank you,
Am thinking the average rating should be a waited average. Not the average rating of total columns in the database. Something like:
โ๐๐=1๐ค๐โ
๐๐
----------
โ๐๐=1๐ค๐
1โ
5+2โ
3+3โ
1+4โ
17+5โ
2. 92 - (Weighted sum)
-------------------------- = ----
5+3+1+17+2 28 - (Total sum)
When I attempt to rate a model after following the configurations i get false from this
! $model instanceof Rater && ! $model instanceof Rating in CanRate Trait
Using version ^1.1 for rennokki/rating
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for rennokki/rating ^1.1 -> satisfiable by rennokki/rating[1.1.0].
- Conclusion: remove laravel/framework v6.0.3
- Conclusion: don't install laravel/framework v6.0.3
- rennokki/rating 1.1.0 requires laravel/framework ~5.5 -> satisfiable by laravel/framework[5.5.x-dev, 5.6.x-dev, 5.7.x-dev, 5.8.x-dev].
- Can only install one of: laravel/framework[5.5.x-dev, v6.0.3].
- Can only install one of: laravel/framework[5.6.x-dev, v6.0.3].
- Can only install one of: laravel/framework[5.7.x-dev, v6.0.3].
- Can only install one of: laravel/framework[5.8.x-dev, v6.0.3].
- Installation request for laravel/framework (locked at v6.0.3, required as ^6.0) -> satisfiable by laravel/framework[v6.0.3].
Installation failed, reverting ./composer.json to its original content.
macwin in ~/Downloads/robi-mylife-master/laravel > composer require rennokki/rating
Using version ^3.0 for rennokki/rating
./composer.json has been updated
Running composer update rennokki/rating
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- rennokki/rating[3.0.0, ..., 3.0.1] require illuminate/database ^7.30|^8.23 -> found illuminate/database[v7.30.0, ..., v7.30.4, v8.23.1, ..., v8.42.1] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires rennokki/rating ^3.0 -> satisfiable by rennokki/rating[3.0.0, 3.0.1].
in CanRate.php line: 80
if (! $this->hasRated($model)) {
return $this->rate($mode, $newRating);
}
Undefined variable: mode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.