<?php

namespace Modules\Lpj\Models;

use Illuminate\Database\Eloquent\Model;
use Modules\Lpj\Database\Factories\TeamsUsersFactory;
use Modules\Usermanagement\Models\User;
use Modules\Lpj\Models\Teams;
use Modules\Lpj\Models\Penilaian;

class TeamsUsers extends Base
{

    /**
     * The attributes that are mass assignable.
     */
    protected $table = 'teams_users';
    protected $fillable = [
        'teams_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
        'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
        'deleted_at', 'deleted_by'
    ];

    public function team()
    {
        return $this->belongsTo(Teams::class, 'teams_id', 'id');
    }


    public function user()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }

    public function penilaianTeam()
    {
        return $this->belongsTo(PenilaianTeam::class, 'team_id', 'id');
    }

}
