<?php

namespace Modules\Lpj\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Modules\Lpj\Database\Factories\RegionsFactory;
use Modules\Lpj\Models\Teams;

class Regions extends Base
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     */
    protected $table = 'regions';

    protected $fillable = [
        'code', 'name', 'status', 'name_url','url','authorized_status', 'authorized_at', 'authorized_by'
    ];

    public function teams(){
        return $this->hasMany(Teams::class, 'regions_id', 'id');
    }

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