Your IP : 216.73.216.91


Current Path : /var/www/html/LLCF-APP/app/Models/
Upload File :
Current File : /var/www/html/LLCF-APP/app/Models/Course.php

<?php

namespace App\Models;

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

class Course extends Model
{
    use HasFactory;

    protected $table = 'courses';

    protected $fillable = [
        'name',
        'code',
    ];

    public function students(): BelongsToMany
    {
        return $this->belongsToMany(VtcStudent::class, 'vtc_student_courses', 'course_id', 'vtc_student_id')
                    ->withTimestamps();
    }
}