What you need to do is separate the public folder, and the application itself.
Move the contents of the public folder, into your shared hosting's public_html folder.
Then create a folder called application outside of the public_html folder, where you upload the rest of your application.
In the index.php file, in public_html folder, you need to update the autoload.php and app.php location to the below values.
require __DIR__.'/../application/bootstrap/autoload.php';
$app = require_once __DIR__.'/../application/bootstrap/app.php';
Now it should work as normal.
And yes, having the .env in a publicly accessible folder is very insecure.