You're using wrong web server configuration. Point your web server to a public
directory and restart it.
For Apache you can use these directives:
DocumentRoot "/path_to_laravel_project/public"
<Directory "/path_to_laravel_project/public">
For nginx, you should change this line:
root /path_to_laravel_project/public;
After doing that, all Laravel files will not be accessible from browser anymore.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…