getKeyName(); if (empty($model->{$key})) { $hashids = new Hashids('', 10); $mt = str_replace('.', '', microtime(true)); $id = $hashids->encode($mt); $model->{$key} = $id; } }); } }