EscolaLMS/Courses

View on GitHub
src/Models/Group.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace EscolaLms\Courses\Models;

use EscolaLms\Auth\Models\Group as AuthGroup;
use EscolaLms\Courses\Database\Factories\GroupFactory;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class Group extends AuthGroup
{
    public function courses(): BelongsToMany
    {
        return $this->belongsToMany(Course::class)->using(CourseGroupPivot::class)->withTimestamps();
    }

    protected static function newFactory()
    {
        return new GroupFactory();
    }
}