12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- namespace App\Repositories\Models;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class CourseVideo.
- *
- * @package namespace App\Repositories\Models;
- */
- class UserVideoWatchRecord extends Model implements Transformable
- {
- use TransformableTrait;
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- // protected $fillable = [];
- protected $guarded = [];
- public function getDurationTextAttribute()
- {
- return sec2time($this->attributes['duration']);
- }
- public function course()
- {
- return $this->belongsTo(Course::class);
- }
- public function video()
- {
- return $this->belongsTo(CourseVideo::class);
- }
- }
|