<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class TeacherRegistration extends Model
{
    use HasFactory;
    protected $table = 'teacher_registrations';
    protected $fillable = ['teacher_id', 'school_id', 'first_name', 'last_name', 'email'];
    
    protected $casts = [
        'teacher_id' => 'integer',
        'school_id' => 'integer',
    ];

    public function teacher(){
        return $this->belongsTo(Teacher::class, 'teacher_id');
    }
    
    public function teacherClasses(){
        return $this->hasMany(TeacherClass::class,'teacher_id');
    }

    public function school()
    {
        return $this->belongsTo(School::class, 'school_id');
    }
    
    
}
