1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Repositories\Models\Course;
- use App\Repositories\Models\Model;
- use App\Repositories\Models\Base\Resource;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class CourseAttach.
- *
- * @package namespace App\Repositories\Models;
- */
- class Attach extends Model implements Transformable
- {
- use TransformableTrait;
- protected $table = 'course_attaches';
- protected static function booted()
- {
- self::language();
- // static::creating(function (Attach $model) {
- //
- // $model->attributes['language']
- // });
- }
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- public function course_video()
- {
- return $this->belongsTo(Video::class, 'course_video_id', 'id');
- }
- public function path_resource()
- {
- return $this->belongsTo(Resource::class, 'path', 'id')->select(['path', 'id', 'url']);
- }
- }
|