40 lines
805 B
PHP
40 lines
805 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class StudentAchievement extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'student_id',
|
|
'achievement_name',
|
|
'category',
|
|
'level',
|
|
'organizer',
|
|
'rank',
|
|
'achievement_date',
|
|
'achievement_year',
|
|
'description',
|
|
'certificate_file',
|
|
'activity_photo',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'achievement_date' => 'date',
|
|
'achievement_year' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function student(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Student::class);
|
|
}
|
|
}
|