reconstruction of the project

This commit is contained in:
root
2026-03-08 16:33:24 -04:00
parent 23b7db1107
commit c8de5f7edc
9157 changed files with 77877 additions and 1073823 deletions
+25 -3
View File
@@ -2,11 +2,15 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\BaseModel;
class CompetitionClassWinner extends Model
class CompetitionClassWinner extends BaseModel
{
protected $table = 'competition_class_winners';
// ✅ CI: useTimestamps = true (created_at/updated_at)
public $timestamps = true;
protected $fillable = [
'competition_id',
'class_section_id',
@@ -21,5 +25,23 @@ class CompetitionClassWinner extends Model
'prize_5',
'prize_6',
];
public $timestamps = true;
protected $casts = [
'competition_id' => 'integer',
'class_section_id' => 'integer',
'question_count' => 'integer',
// If winners_override is JSON in DB, cast to array:
'winners_override' => 'array',
];
/* Optional relationships */
public function competition()
{
return $this->belongsTo(Competition::class, 'competition_id');
}
public function classSection()
{
return $this->belongsTo(ClassSection::class, 'class_section_id');
}
}