<?php

namespace App\Models;

use App\Models\Tkelasjenis;
use App\Models\Ttahunajaran;
use Illuminate\Database\Eloquent\Model;

    class Tkelas extends Model
    {
        protected $connection = 'mai1';
        protected $table = 'tkelas';
        protected $primaryKey = 'id';
        public $timestamps = false;
        protected $appends = [];
        protected $hidden = [
            'jenis',
            "createdat",
            "updatedat",
            "createdby",
            "updatedby",
        ];
        // protected $fillable = [
        //     'id',
        //     'tin',
        //     'idta',
        //     'nam',
        //     'jen',
        //     'lev',
        //     'qty',
        //     'idk',
        //     'ket',
        //     'sta',
        //     'rev',
        //     'createdat',
        //     'updatedat',
        //     'createdby',
        //     'updatedby',
        // ];

        public function jenis()
        {
            return $this->belongsTo(Tkelasjenis::class, 'jen', 'id');
        }

        public function tahunajaran()
        {
            return $this->belongsTo(Ttahunajaran::class, 'idta', 'id');
        }
    }
