src/Translatable/Translatable.php
public function scopeWithTranslation(Builder $query, $locales = [])
    {
        $query->with(['translations' => function (Relation $query) use ($locales) {
            $query->where(function ($query) use ($locales) {
                $query->where($this->getTranslationsTable().'.'.$this->getLocaleKey(), $this->locale());

                if(count($locales) > 0){
                    foreach ($locales as $locale){
                        if($locale != $this->locale()){
                            $query->orWhere($this->getTranslationsTable().'.'.$this->getLocaleKey(), $locale);
                        }
                    }
                }

                if ($this->useFallback()) {
                    return $query->orWhere($this->getTranslationsTable().'.'.$this->getLocaleKey(), $this->getFallbackLocale());
                }

            });
        }]);
    }
public function scopeWithTranslation(Builder $query, $locales = [])
    {
        $query->with(['translations' => function (Relation $query) use ($locales) {
            $query->where(function ($query) use ($locales) {
                $query->where($this->getTranslationsTable().'.'.$this->getLocaleKey(), $this->locale());

                if(count($locales) > 0){
                    foreach ($locales as $locale){
                        if($locale != $this->locale()){
                            $query->orWhere($this->getTranslationsTable().'.'.$this->getLocaleKey(), $locale);
                        }
                    }
                }

                if ($this->useFallback()) {
                    return $query->orWhere($this->getTranslationsTable().'.'.$this->getLocaleKey(), $this->getFallbackLocale());
                }

            });
        }]);
    }
This scope eager loads the translations for the default and the fallback locale only.
We can use this as a shortcut to improve performance in our application.

@param Builder $query
@param array   $locales