<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Grupo extends Model
{
    protected $guarded = [];
    public $timestamps = false;

    public function alumnos(): BelongsToMany
    {
        return $this->belongsToMany(Alumno::class);
    }

    public function docentes(): BelongsToMany
    {
        return $this->belongsToMany(Docente::class, 'docente_grupo')
                    ->withPivot('materia_id');
    }

    public function plan()
    {
        return $this->belongsTo(Plan::class);
    }
}
