123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Repositories\Models\Course;
- use App\Repositories\Models\Model;
- use Jenssegers\Mongodb\Eloquent\SoftDeletes;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class CourseChapter.
- *
- * @package namespace App\Repositories\Models;
- */
- class Chapter extends Model implements Transformable
- {
- use TransformableTrait;
- use SoftDeletes;
- protected $table = 'course_chapters';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- // protected $fillable = ['title', 'sort', 'status', 'course_id'];
- protected $guarded = [];
- protected static function booted()
- {
- self::language();
- }
- public function videos()
- {
- return $this->hasMany(Video::class, 'course_chapter_id', 'id');
- }
- public function course()
- {
- return $this->belongsTo(Course::class);
- }
- }
|