Code Duplication    Length = 9-9 lines in 2 locations

src/Translatable/Translatable.php 2 locations

@@ 600-608 (lines=9) @@
597
     *
598
     * @return \Illuminate\Database\Eloquent\Builder|static
599
     */
600
    public function scopeWhereTranslation(Builder $query, $key, $value, $locale = null)
601
    {
602
        return $query->whereHas('translations', function (Builder $query) use ($key, $value, $locale) {
603
            $query->where($this->getTranslationsTable().'.'.$key, $value);
604
            if ($locale) {
605
                $query->where($this->getTranslationsTable().'.'.$this->getLocaleKey(), $locale);
606
            }
607
        });
608
    }
609
610
    /**
611
     * This scope filters results by checking the translation fields.
@@ 640-648 (lines=9) @@
637
     *
638
     * @return \Illuminate\Database\Eloquent\Builder|static
639
     */
640
    public function scopeWhereTranslationLike(Builder $query, $key, $value, $locale = null)
641
    {
642
        return $query->whereHas('translations', function (Builder $query) use ($key, $value, $locale) {
643
            $query->where($this->getTranslationsTable().'.'.$key, 'LIKE', $value);
644
            if ($locale) {
645
                $query->where($this->getTranslationsTable().'.'.$this->getLocaleKey(), 'LIKE', $locale);
646
            }
647
        });
648
    }
649
650
    /**
651
     * This scope filters results by checking the translation fields.