code: public function replicate()
      {
          return function ($next, $copy, $args) {
              $metaAttributes = $args->get('original')
                                      ->getMetaAttributes()
                                      ->replicate($args->get('except'));
  
              $copy->setRelation('metaAttributes', $metaAttributes);
  
              return $next($copy, $args);
          };
      }
docs: Register hook on replicate method.
  
  @return \Closure