Code Duplication    Length = 11-11 lines in 2 locations

Apps/Model/Admin/Content/FormContentUpdate.php 1 location

@@ 234-244 (lines=11) @@
231
     * Generate random string for comment hash value
232
     * @return string
233
     */
234
    private function generateCommentHash()
235
    {
236
        $hash = Str::randomLatinNumeric(mt_rand(32, 128));
237
        $find = Content::where('comment_hash', '=', $hash)->count();
238
        // hmmm, is always exist? Chance of it is TOOOO low, but lets recursion re-generate
239
        if ($find !== 0) {
240
            return $this->generateCommentHash();
241
        }
242
243
        return $hash;
244
    }
245
}

Apps/Model/Front/Content/FormNarrowContentUpdate.php 1 location

@@ 214-224 (lines=11) @@
211
     * Generate random string for comment hash value
212
     * @return string
213
     */
214
    private function generateCommentHash()
215
    {
216
        $hash = Str::randomLatinNumeric(mt_rand(32, 128));
217
        $find = Content::where('comment_hash', '=', $hash)->count();
218
        // hmmm, is always exist? Chance of it is TOOOO low, but lets recursion re-generate
219
        if ($find !== 0) {
220
            return $this->generateCommentHash();
221
        }
222
223
        return $hash;
224
    }
225
}