add poker planing for students

This commit is contained in:
2025-11-15 11:11:04 +03:00
parent a78b63ea2d
commit cf635f81dd
14 changed files with 2799 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class EstimationRound extends Model
{
protected $fillable = ['token', 'max_score', 'max_voters'];
public function votes()
{
return $this->hasMany(Vote::class);
}
public function getAverageScoreAttribute()
{
return $this->votes->avg('score');
}
}

15
app/Models/Vote.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Vote extends Model
{
protected $fillable = ['estimation_round_id', 'name', 'score'];
public function estimationRound()
{
return $this->belongsTo(EstimationRound::class);
}
}