1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace App\Repositories\Models\Exam;
- use App\Repositories\Models\Course\Category;
- use App\Repositories\Models\Model;
- use Prettus\Repository\Contracts\Transformable;
- use Prettus\Repository\Traits\TransformableTrait;
- /**
- * Class Topic.
- *
- * @package namespace App\Repositories\Models\Exam;
- */
- class Topic extends Model implements Transformable
- {
- use TransformableTrait;
- protected $table = 'exam_topics';
- protected $casts = [
- 'body' => 'array',
- 'result' => 'array',
- ];
- /**
- * The attributes that are mass assignable.
- *
- * @var array
- */
- protected $guarded = [];
- public function category()
- {
- return $this->belongsTo(Category::class)->select(['id', 'name']);
- }
- }
|