create: add models for literacy story text
This commit is contained in:
parent
3493e49162
commit
8403f2dd6c
|
|
@ -21,4 +21,9 @@ public function questions()
|
||||||
{
|
{
|
||||||
return $this->hasMany(LiteracyQuestion::class, 'material_id');
|
return $this->hasMany(LiteracyQuestion::class, 'material_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function storyTexts()
|
||||||
|
{
|
||||||
|
return $this->hasMany(LiteracyStoryText::class, 'material_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Literacy;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class LiteracyStoryText extends Model
|
||||||
|
{
|
||||||
|
use HasFactory;
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'material_id',
|
||||||
|
'story_text',
|
||||||
|
];
|
||||||
|
|
||||||
|
// Relasi ke LiteracyMaterial
|
||||||
|
public function material()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(LiteracyMaterial::class, 'material_id');
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user