Level 50
How are you actually doing the loop/calculation? It's hard to offer much help without knowing :-) Are you doing a DB:: call or a foreach() for instance?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi I have just implemented a rating system for myself.
A have 3 model and tables: venue, user, review.
think of venue as a score.
my rating table looks like this:
Schema::create('reviews', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->integer('venue_id')->unsigned();
$table->foreign('venue_id')->references('id')->on('venues')->onDelete('cascade');
$table->tinyInteger('quality');
$table->tinyInteger('cost');
$table->timestamps();
});
Please or to participate in this conversation.