123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace App\Repositories\Models\School;
- use Illuminate\Database\Eloquent\Model;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class Lesson.
- *
- * @package namespace App\Repositories\Models\School;
- */
- class Lesson extends Model implements Transformable
- {
- use TransformableTrait;
- protected $table = 'school_lessons';
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- public function category()
- {
- return $this->belongsTo(\App\Repositories\Models\Base\Category::class)->select(['id', 'name']);
- }
- public function teacher()
- {
- return $this->belongsTo(Teacher::class)->select(['id', 'name', 'account']);
- }
- }
|