public function getTranslationsAttribute()
    {
        $translationData = [];
        $translations = Translation::where('entity_id', $this->id)->where('entity_type', get_class($this))->get();

        foreach ($translations as $translation) {
            $translationData[] = $translation->data->attributes;
        }

        return $translationData;
    }
public function getTranslationsAttribute()
    {
        $translationData = [];
        $translations = Translation::where('entity_id', $this->id)->where('entity_type', get_class($this))->get();

        foreach ($translations as $translation) {
            $translationData[] = $translation->data->attributes;
        }

        return $translationData;
    }
public function getTranslationsAttribute ( ) { $ translationData = [ ] ; $ translations = Translation :: where ( 'entity_id' , $ this -> id ) -> where ( 'entity_type' , get_class ( $ this ) ) -> get ( ) ; foreach ( $ translations as $ translation ) { $ translationData [ ] = $ translation -> data -> attributes ; } return $ translationData ; }
Get a translations attribute.

@return array
Get a translations attribute .