refactor: rename InternshipStatus model to InternshipStatusData

This commit is contained in:
2025-11-29 12:32:43 +01:00
parent 5b86f2e355
commit b79c76d947
8 changed files with 17 additions and 17 deletions

View File

@@ -0,0 +1,52 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class InternshipStatusData extends Model
{
/** @use HasFactory<\Database\Factories\InternshipStatusFactory> */
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var list<string>
*/
protected $fillable = [
'internship_id',
'status',
'changed',
'note',
'modified_by'
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'created_at',
'updated_at',
];
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,
'changed' => $this->changed,
'note' => $this->note,
'modified_by' => $this->modifiedBy,
];
}
}