From 5e7cdcd16424a912e1f630eb5de7b1b8b2161ab0 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Tue, 14 Jan 2025 09:22:58 +0700 Subject: [PATCH] fix(models): perbaiki format dan penamaan fungsi dalam model PenilaianTeam - Memperbaiki format array $fillable untuk konsistensi. - Menmbahkan relasi 'user' untuk mempermudah pemanggilan. - Menambahkan spasi dan format yang lebih baik pada fungsi. --- app/Models/PenilaianTeam.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Models/PenilaianTeam.php b/app/Models/PenilaianTeam.php index a61b5dd..adcd268 100644 --- a/app/Models/PenilaianTeam.php +++ b/app/Models/PenilaianTeam.php @@ -15,7 +15,7 @@ class PenilaianTeam extends Model /** * The attributes that are mass assignable. */ - protected $fillable = ['penilaian_id', 'team_id', 'user_id','role']; + protected $fillable = ['penilaian_id', 'team_id', 'user_id', 'role']; public function userPenilaiTeam() @@ -23,12 +23,19 @@ class PenilaianTeam extends Model return $this->belongsTo(User::class, 'user_id', 'id'); } - public function team(){ + public function team() + { return $this->belongsTo(Teams::class, 'team_id', 'id'); } - public function penilaian(){ + public function user() + { + return $this->belongsTo(User::class, 'user_id', 'id'); + } + + public function penilaian() + { return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id'); }