reconstruction of the project
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Models\BaseModel;
|
||||
|
||||
class PlacementScore extends Model
|
||||
class PlacementScore extends BaseModel
|
||||
{
|
||||
protected $table = 'placement_scores';
|
||||
|
||||
// ✅ CI: useTimestamps = true (created_at/updated_at)
|
||||
public $timestamps = true;
|
||||
|
||||
protected $fillable = [
|
||||
'batch_id',
|
||||
'student_id',
|
||||
@@ -16,5 +20,33 @@ class PlacementScore extends Model
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
public $timestamps = true;
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user