<?php

namespace Modules\Lpj\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\TeamsFactory;
use Modules\Lpj\Models\TeamsUsers;
use Modules\Lpj\Models\Regions;
use Modules\Lpj\Models\Penilaian;


class Teams extends Base
{
    /**
     * The attributes that are mass assignable.
     */
    protected $table = 'teams';
    protected $fillable = [
        'regions_id', 'code', 'name', 'status', 'authorized_status', 'authorized_at',
        'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
        'deleted_at', 'deleted_by'
    ];

    public function regions(){
        return $this->belongsTo(Regions::class, 'regions_id', 'id');
    }

    public function teamsUsers(){
        return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
    }

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



}

