e13df69885
API CI/CD / Validate (composer + pint) (push) Successful in 3m6s
API CI/CD / Test (PHPUnit) (push) Failing after 4m53s
API CI/CD / Build frontend assets (push) Successful in 1m2s
API CI/CD / Security audit (push) Failing after 59s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
class PlacementScore extends BaseModel
|
|
{
|
|
protected $table = 'placement_scores';
|
|
|
|
// ✅ legacy: useTimestamps = true (created_at/updated_at)
|
|
public $timestamps = true;
|
|
|
|
protected $fillable = ['batch_id', 'student_id', 'score', 'created_by', 'updated_by', 'created_at', 'updated_at'];
|
|
|
|
protected $casts = [
|
|
'batch_id' => 'integer',
|
|
'student_id' => 'integer',
|
|
'score' => 'decimal:2', // change to 'integer' if score is whole number
|
|
'created_by' => 'integer',
|
|
'updated_by' => 'integer',
|
|
];
|
|
|
|
/* Optional relationships */
|
|
public function batch()
|
|
{
|
|
return $this->belongsTo(PlacementBatch::class, 'batch_id');
|
|
}
|
|
|
|
public function student()
|
|
{
|
|
return $this->belongsTo(Student::class, 'student_id');
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function updater()
|
|
{
|
|
return $this->belongsTo(User::class, 'updated_by');
|
|
}
|
|
}
|