Accessing preloadedResolverData on the interface OwenIt\Auditing\Contracts\Auditable suggest that you code against a concrete implementation. How about adding an instanceof check?
The expression return $auditable->prelo...t::header('User-Agent') could return the type array|null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.