123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Repositories\Models\Course;
- use App\Repositories\Models\Base\Admin;
- use App\Repositories\Models\Model;
- use App\Repositories\Models\Base\User;
- class Node extends Model
- {
- /**
- * @var string
- */
- protected $table = 'course_nodes';
- protected $guarded = [];
- /**
- * The attributes excluded from the model's JSON form.
- *
- * @var array
- */
- protected $hidden = [];
- public function user()
- {
- return $this->belongsTo(User::class, 'user_id', 'id')->select(['id', 'name', 'username', 'mobile']);
- }
- public function course()
- {
- return $this->belongsTo(Course::class)->with(['thumb_resource'])->select(['id', 'title', 'thumb', 'labels']);
- }
- public function video()
- {
- return $this->belongsTo(Video::class)->select(['id', 'title']);
- }
- }
|