123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?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';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- protected static function booted()
- {
- self::language();
- }
- 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']);
- }
- }
|