<?php

namespace App\Models;

use App\Enums\Language;
use App\Enums\WordStatus;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Word extends Model
{
    use HasFactory;

    protected $fillable = [
        'word',
        'part_of_speech',
        'language',
        'meaning',
        'synonyms',
        'examples',
        'translations',
        'user_id',
        'status',
       
    ];

    protected $casts = [
        'synonyms' => 'array',
        'translations' => 'array',
        'status'=>WordStatus::class,
        'language'=>Language::class,
    ];

  public function user(){
    return $this->belongsTo(User::class);
  }
}
