I'm Jiajian Chan.
🕹 Web Developer
:tada: The package helps you to add user based vote system to your model.
License: MIT License
I'm Jiajian Chan.
🕹 Web Developer
执行完命令
php artisan vendor:publish --provider="Jcc\LaravelVote\VoteServiceProvider" --tag="migrations"
提示:Publishing complete.
这是什么情况呢
我在Blade模板使用{{ $topic->countVoters() }}
输出$topic的总vote数,但为什么它会去数据表里面找topic_id
?我代码里面没写这个,自然也不可能找到。
For some reason a couple of weird things are happening to my installation.
Firstly, the comment model doesn't work, at all. $comment->voters();
only gives Illuminate\Database\Eloquent\Relations\MorphToMany
, and every other Comment model command gives Illuminate\Database\QueryException with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'votes.comment_id' in 'on clause' (SQL: select count(*) as aggregate from 'comments' inner join 'votes' on 'comments'.'id' = 'votes'.'comment_id' where 'votes'.'votable_id' = 3 and 'votes'.'votable_type' = App\Comment)'
. For some reason it's looking for a column in the votes-table with name 'comment_id, but I don't know why.
Secondly, when a comment gets voted, the votable_type value is App\User
, while it should be App\Comment
, because otherwise the Comment Model commands just show 0 (I know this because I manually created the correct setup, all Comment Model commands then work as expected.
Thanks in advance!
Right seems everything goes to 'votes' table and can't change it unless you modify the package
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.