src/Sluggable/SluggableTranslatedTrait.php
public static function findBySlug($slug, $locale = null)
    {
        /** @var \Dimsav\Translatable\Translatable $model */
        $model = (new static);

        /** @var SluggableTrait $translationModel */
        $translationModel = $model->getTranslationModelName();
        $parentKey        = $model->getRelationKey();

        $translationInstance = $translationModel::findBySlug($slug, $locale);

        if (empty($translationInstance)) return null;

        return static::find($translationInstance->{$parentKey});
    }
public static function findBySlug($slug, $locale = null)
    {
        /** @var \Dimsav\Translatable\Translatable $model */
        $model = (new static);

        /** @var SluggableTrait $translationModel */
        $translationModel = $model->getTranslationModelName();
        $parentKey        = $model->getRelationKey();

        $translationInstance = $translationModel::findBySlug($slug, $locale);

        if (empty($translationInstance)) return null;

        return static::find($translationInstance->{$parentKey});
    }
public static function findBySlug ( $ slug , $ locale = null ) { /** @var \Dimsav\Translatable\Translatable $model */ $ model = ( new static ) ; /** @var SluggableTrait $translationModel */ $ translationModel = $ model -> getTranslationModelName ( ) ; $ parentKey = $ model -> getRelationKey ( ) ; $ translationInstance = $ translationModel :: findBySlug ( $ slug , $ locale ) ; if ( empty ( $ translationInstance ) ) return null ; return static :: find ( $ translationInstance -> { $ parentKey } ) ; }
Find by slug on translated attribute

@param string $slug
@param string $locale optional, if omitted returns for any locale
@return $this|null
Find by slug on translated attribute