$myWords = Word::all();
$wordsFromFile = [];
foreach($words as $word => $translation)
{
$word = mb_strtolower($word);
$translation = mb_strtolower($translation);
$wordInDatabase = $myWords->where('word', $word)->first();
if($wordInDatabase == null)
{
$wordsFromFile[] = [
'word' => $word,
'translation' => $translation,
'state' => 0,
];
}
}
Word::insert($wordsFromFile);