<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Materia extends Model
{
    protected $guarded = [];

    public function plan()    { return $this->belongsTo(Plan::class); }
    public function tareas()  { return $this->hasMany(Tarea::class); }
    public function docentes() {
        return $this->belongsToMany(Docente::class, 'docente_grupo')
                    ->withPivot('grupo_id');
    }
}
