You should move it out of DOCUMENT_ROOT.
The usual structure of a framework application is that the top level directory (containing stuff and also the composer.json file) is NOT the DOCUMENT_ROOT. There usualls is a dedicated directory for this, maybe named "public" or "htdocs" inside that contains all the usual assets (CSS, JS, pics) next to "the" central index.php file.
If you can't get that layout with a shared hosting, you probably should move on, because you cannot hide files from direct HTTP access there.