/** * Get available languages for a translation * * @param string $key * @return array */ public function availableTranslations(string $key) { return collect(Languages::whereIn('id', collect(StringTranslations::whereSearchKey(md5($key)))->pluck('language_id')->toArray()))->pluck('abbreviation')->toArray(); }
/** * Get available languages for a certain route * * @param string $route * @return array */ public function availableTranslations(string $route) { return collect(Languages::whereIn('id', collect(RouteTranslations::whereRoute($route))->pluck('language_id')->toArray()))->pluck('abbreviation')->toArray(); }