*/ use HasFactory; /** * The attributes that are mass assignable. * * @var list */ protected $fillable = [ 'internship_id', 'status', 'changed', 'note', 'modified_by' ]; /** * The attributes that should be hidden for serialization. * * @var list */ protected $hidden = [ 'created_at', 'updated_at', ]; protected $table = 'internship_statuses'; /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'status' => '\App\Enums\InternshipStatus', ]; } public function modifiedBy() { return $this->belongsTo(User::class, 'modified_by'); } public function toArray() { return [ 'id' => $this->id, 'internship_id' => $this->internship_id, 'status' => $this->status->value, 'changed' => $this->changed, 'note' => $this->note, 'modified_by' => $this->modifiedBy, ]; } }