Initial commit
This commit is contained in:
commit
c909d539bc
7178 files changed
+756624
No files matched your search
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Lesson extends Model
|
||||
{
|
||||
protected $fillable = ['chapter_id','lesson_section_id','title','description','order', 'slug'];
|
||||
|
||||
//protected $fillable = ['lesson_section_id', 'title', 'description', 'video_url', 'order'];
|
||||
|
||||
public function lessonSection()
|
||||
{
|
||||
return $this->belongsTo(LessonSection::class);
|
||||
}
|
||||
|
||||
public function chapter()
|
||||
{
|
||||
return $this->belongsTo(Chapter::class);
|
||||
}
|
||||
|
||||
public function videos()
|
||||
{
|
||||
return $this->hasMany(LessonVideo::class)->orderBy('order');
|
||||
}
|
||||
|
||||
public function progress()
|
||||
{
|
||||
return $this->hasMany(LessonProgress::class);
|
||||
}
|
||||
|
||||
public function questions()
|
||||
{
|
||||
return $this->hasMany(LessonQuestion::class);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user