40 lines
706 B
PHP
40 lines
706 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class courses extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
|
|
protected $table = 'courses';
|
|
|
|
|
|
protected $fillable = [
|
|
'title',
|
|
'image',
|
|
'duration',
|
|
'level',
|
|
'author',
|
|
'desc',
|
|
'student',
|
|
'rating',
|
|
'badge',
|
|
'trending',
|
|
'course_code',
|
|
'status'
|
|
];
|
|
|
|
public function students()
|
|
{
|
|
return $this->belongsToMany(
|
|
StudentDetail::class,
|
|
'course_assign_student',
|
|
'course_id',
|
|
'student_details_id'
|
|
);
|
|
}
|
|
} |