create: add models for literacy story text
This commit is contained in:
parent
8652a61241
commit
e000a50bc4
|
|
@ -21,4 +21,9 @@ public function questions()
|
|||
{
|
||||
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