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.
This commit is contained in:
@@ -15,7 +15,7 @@ class PenilaianTeam extends Model
|
|||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* 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()
|
public function userPenilaiTeam()
|
||||||
@@ -23,12 +23,19 @@ class PenilaianTeam extends Model
|
|||||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function team(){
|
public function team()
|
||||||
|
{
|
||||||
|
|
||||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
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');
|
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user