There is no necessity to change any PHP code for doing this.

You just need to create `{MODULE_NAME}/etc/catalog_attributes.xml` with such content:

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
        <group name="quote_item">
            <attribute name="sample_attr"/>
        </group>
    </config>

After that apply a commands like:

    php bin/magento setup:upgrade

after that regenerate your static content by running the following command

    php bin/magento setup:static-content:deploy

at last apply permission

    chmod -R 777 var pub