Translations/CategoryTranslation.php
public function getFullSlug() : string
    {
        $categories = Category::with('ancestors')->ancestorsAndSelf($this->category->id);

        $slug = "";

        foreach ($categories as $category) {
            $translation = $category->translations->where('locale', $this->locale)->first();
            $slug .= $translation->slug . '/';
        }

        $slug = substr($slug, 0, -1);

        return $slug;
    }
public function getFullSlug() : string
    {
        $categories = Category::with('ancestors')->ancestorsAndSelf($this->category->id);

        $slug = "";

        foreach ($categories as $category) {
            $translation = $category->translations->where('locale', $this->locale)->first();
            $slug .= $translation->slug . '/';
        }

        $slug = substr($slug, 0, -1);

        return $slug;
    }
public function getFullSlug ( ) : string { $ categories = Category :: with ( 'ancestors' ) -> ancestorsAndSelf ( $ this -> category -> id ) ; $ slug = "" ; foreach ( $ categories as $ category ) { $ translation = $ category -> translations -> where ( 'locale' , $ this -> locale ) -> first ( ) ; $ slug .= $ translation -> slug . '/' ; } $ slug = substr ( $ slug , 0 , - 1 ) ; return $ slug ; }
Get full slug of the category

@return string
Get full slug of the category