src/Models/CourseAuthorPivot.php
<?php
namespace EscolaLms\Courses\Models;
use EscolaLms\Core\Models\User;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\Pivot;
class CourseAuthorPivot extends Pivot
{
protected $table = 'course_author';
public function author(): BelongsTo
{
return $this->belongsTo(User::class);
}
public function course(): BelongsTo
{
return $this->belongsTo(Course::class);
}
}