Code Duplication    Length = 8-8 lines in 2 locations

src/Model/EloquentModel.php 2 locations

@@ 339-346 (lines=8) @@
336
    {
337
        $locale = $locale ?: $this->getFallbackLocale();
338
339
        foreach ($this->translations as $translation) {
340
341
            $translation->setRelation('parent', $this);
342
343
            if ($translation->getAttribute($this->getLocaleKey()) == $locale) {
344
                return true;
345
            }
346
        }
347
348
        return false;
349
    }
@@ 585-592 (lines=8) @@
582
583
    private function getTranslationByLocaleKey($key)
584
    {
585
        foreach ($this->translations as $translation) {
586
587
            $translation->setRelation('parent', $this);
588
589
            if ($translation->getAttribute($this->getLocaleKey()) == $key) {
590
                return $translation;
591
            }
592
        }
593
594
        return null;
595
    }