src/Controller.php
/**
     * postSearchString - search for keys/translations in ltm_translations table by %string% and list all matches
     *
     * @param  mixed $request
     * @return void
     */
search for keys/translations in ltm_translations table by %string% and list all matches

@param  mixed $request
@return void
search for keys / translations in ltm_translations table by %string% and list all matches @param mixed $request @return void
public function postSearchString(Request $request)
    {
        $allStrings = Translation::where('key', 'LIKE', '%'.$request->string_to_find.'%')
            ->orWhere('value', 'LIKE', '%'.$request->string_to_find.'%')
            ->orderBy('id', 'desc')->get();
        $numChanged=0;
        $translationsBundle = [];
        foreach($allStrings as $translation) {
            $translationsBundle[$translation->key][$translation->locale] = $translation;
            if($translation->status==Translation::STATUS_CHANGED) {
                $numChanged++;
            }
        }
        $locales = $this->manager->getLocales();
        $numTranslations = count($translationsBundle);
        return view('translation-manager::translation_table')
            ->with('translationsBundle', $translationsBundle)
            ->with('locales', $locales)
            ->with('numTranslations', $numTranslations)
            ->with('numChanged', $numChanged);
    }
public function postSearchString ( Request $ request ) { $ allStrings = Translation :: where ( 'key' , 'LIKE' , '%' . $ request -> string_to_find . '%' ) -> orWhere ( 'value' , 'LIKE' , '%' . $ request -> string_to_find . '%' ) -> orderBy ( 'id' , 'desc' ) -> get ( ) ; $ numChanged = 0 ; $ translationsBundle = [ ] ; foreach ( $ allStrings as $ translation ) { $ translationsBundle [ $ translation -> key ] [ $ translation -> locale ] = $ translation ; if ( $ translation -> status == Translation :: STATUS_CHANGED ) { $ numChanged ++ ; } } $ locales = $ this -> manager -> getLocales ( ) ; $ numTranslations = count ( $ translationsBundle ) ; return view ( 'translation-manager::translation_table' ) -> with ( 'translationsBundle' , $ translationsBundle ) -> with ( 'locales' , $ locales ) -> with ( 'numTranslations' , $ numTranslations ) -> with ( 'numChanged' , $ numChanged ) ; }
postSearchString - search for keys/translations in ltm_translations table by %string% and list all matches
postSearchString - search for keys / translations in ltm_translations table by %string% and list all matches