mirror of
https://github.com/nihonbuzz/nihonbuzz-academy.git
synced 2026-01-26 13:32:07 +07:00
38 lines
833 B
PHP
38 lines
833 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Vocabulary extends Model
|
|
{
|
|
use HasFactory, HasUuids;
|
|
|
|
protected $fillable = [
|
|
'word', 'reading', 'romaji', 'meaning_en', 'meaning_id',
|
|
'level_id', 'audio_url', 'type', 'stroke_order_svg', 'example_sentences'
|
|
];
|
|
|
|
protected $casts = [
|
|
'stroke_order_svg' => 'array',
|
|
'example_sentences' => 'array',
|
|
];
|
|
|
|
public function reviews()
|
|
{
|
|
return $this->hasMany(SrsReview::class);
|
|
}
|
|
|
|
public function level()
|
|
{
|
|
return $this->belongsTo(Level::class);
|
|
}
|
|
|
|
public function lessons()
|
|
{
|
|
return $this->belongsToMany(Lesson::class, 'lesson_vocabulary');
|
|
}
|
|
}
|