Lesson.php 791 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Repositories\Models\School;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Prettus\Repository\Contracts\Transformable;
  5. use Prettus\Repository\Traits\TransformableTrait;
  6. /**
  7. * Class Lesson.
  8. *
  9. * @package namespace App\Repositories\Models\School;
  10. */
  11. class Lesson extends Model implements Transformable
  12. {
  13. use TransformableTrait;
  14. protected $table = 'school_lessons';
  15. /**
  16. * The attributes that are mass assignable.
  17. *
  18. * @var array
  19. */
  20. protected $guarded = [];
  21. public function category()
  22. {
  23. return $this->belongsTo(\App\Repositories\Models\Base\Category::class)->select(['id', 'name']);
  24. }
  25. public function teacher()
  26. {
  27. return $this->belongsTo(Teacher::class)->select(['id', 'name', 'account']);
  28. }
  29. }