Subscribe.php 669 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Repositories\Models\Course;
  3. use App\Repositories\Models\Base\Admin;
  4. use App\Repositories\Models\Model;
  5. class Subscribe extends Model
  6. {
  7. /**
  8. * @var string
  9. */
  10. protected $table = 'course_subscribes';
  11. /**
  12. * The attributes that are mass assignable.
  13. *
  14. * @var array
  15. */
  16. protected $guarded = [];
  17. public function course()
  18. {
  19. return $this->belongsTo(Course::class)->with(['thumb_resource'])->select(['id', 'title', 'thumb', 'labels']);
  20. }
  21. public function user()
  22. {
  23. return $this->belongsTo(Admin::class, 'user_id', 'id')->select(['id', 'name', 'username', 'mobile']);
  24. }
  25. }