1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace App\Repositories\Models\Course;
- use App\Repositories\Models\Base\Admin;
- use App\Repositories\Models\Model;
- class Subscribe extends Model
- {
- /**
- * @var string
- */
- protected $table = 'course_subscribes';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- public function course()
- {
- return $this->belongsTo(Course::class)->with(['thumb_resource'])->select(['id', 'title', 'thumb', 'labels']);
- }
- public function user()
- {
- return $this->belongsTo(Admin::class, 'user_id', 'id')->select(['id', 'name', 'username', 'mobile']);
- }
- }
|