Support the ongoing development of Laravel.io →
Installation Authentication Database
Last updated 1 year ago.
0

If I understood you correctly, I believe you're looking to remove the public segments from your application. Try the following steps.

Open the index.php file and change from:

require __DIR__.'/../bootstrap/autoload.php';

$app = require_once __DIR__.'/../bootstrap/start.php';

to:

require __DIR__.'/bootstrap/autoload.php';

$app = require_once __DIR__.'/bootstrap/start.php';

And also, open the paths.php file under the bootstrap folder, and then change from:

'public' => __DIR__.'/../public'

to:

'public' => __DIR__.'/..'

P.S. Don't forget to restart your Web server.

0

Try what rayeess suggested, however you should be using the public directory for your web files. Your document root in your virtual host should be set to the public folder for security reasons

0

T>tuyenlaptrinh said:

http://duytuyen.com/php/xoa-thu-muc-public-cua-laravel.html

May be help you

That might if it was in ENGLISH.. ;)

0

You can use translate of chrome or follow step by step in images

0
  • Create a new folder in the root of the project called laravel and move all files and folders into that directory EXCEPT the public folder.

  • Move /public files into root directory and delete the now empty public folder

  • Modify index.php

require __DIR__.'/../bootstrap/autoload.php';

Replace with

require __DIR__.'/laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/start.php';

Replace with
	
$app = require_once __DIR__.'/laravel/bootstrap/start.php';
  • Modify laravel/bootstrap/paths.php
'public' => __DIR__.'/../public',

Replace with
	
'public' => __DIR__.'/../..',
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.