You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
994 B
50 lines
994 B
<?php
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class Exercise extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'se_exercises';
|
|
|
|
protected $fillable = [
|
|
'subject_id',
|
|
'lesson_name',
|
|
'description',
|
|
'level',
|
|
'avatar',
|
|
'status',
|
|
'category_id',
|
|
'skill_id',
|
|
'year',
|
|
'media_object_id',
|
|
];
|
|
|
|
public function subject()
|
|
{
|
|
return $this->belongsTo(Subject::class, 'subject_id');
|
|
}
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(Category::class, 'category_id');
|
|
}
|
|
|
|
public function skill()
|
|
{
|
|
return $this->belongsTo(Skill::class, 'skill_id');
|
|
}
|
|
|
|
public function questionGroups()
|
|
{
|
|
return $this->hasMany(QuestionGroup::class, 'exercise_id');
|
|
}
|
|
|
|
public function questions()
|
|
{
|
|
return $this->hasMany(Question::class, 'exercise_id');
|
|
}
|
|
}
|
|
|