<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

/**
 * @property int $id
 * @property string $name
 * @property string $photo
 * @property string $bio
 * @property Carbon $created_at
 * @property Carbon $updated_at
 */
class Teacher extends Model
{
    /** @use HasFactory<\Database\Factories\TeacherFactory> */
    use HasFactory;

    public function ledGroups(): HasMany
    {
        return $this->hasMany(Group::class, 'leader_teacher_id');
    }

    public function assistedGroups(): BelongsToMany
    {
        return $this->belongsToMany(Group::class, 'group_teacher');
    }
}
