fix: add hidden attributes for serialization in models and update contact method in Company model

This commit is contained in:
2025-11-06 15:54:54 +01:00
parent cd7e39eccb
commit 6eadf3a944
5 changed files with 92 additions and 1 deletions

View File

@@ -23,6 +23,16 @@ class Company extends Model
'hiring'
];
/**
* The attributes that should be hidden for serialization.
*
* @var list<string>
*/
protected $hidden = [
'created_at',
'updated_at',
];
/**
* Get the internships for the company.
*/
@@ -34,7 +44,7 @@ class Company extends Model
/**
* Get the contact person (user) for the company.
*/
public function contactPerson()
public function contact()
{
return $this->belongsTo(User::class, 'contact');
}