Because there are other items in the Web root directory, a Laravel folder is built in the root directory for test learning, and a welcome page is available to access http://localhost/laravel/public. Later want to remove public, refer to this site http://tutsnare.com/remove-public-from-url-laravel/the second method, direct access to Http://localhost/laravel can see the Welcome page. When learning to route, add a
Route::post('test', function(){ return 'test';});
Then access to Http://localhost/laravel/test has been 404, where is the problem?
Reply content:
Because there are other items in the Web root directory, a Laravel folder is built in the root directory for test learning, and a welcome page is available to access http://localhost/laravel/public. Later want to remove public, refer to this site http://tutsnare.com/remove-public-from-url-laravel/the second method, direct access to Http://localhost/laravel can see the Welcome page. When learning to route, add a
Route::post('test', function(){ return 'test';});
Then access to Http://localhost/laravel/test has been 404, where is the problem?
First, first this is a post
route, if it is http://localhost/laravel/test access:
Route::get('test', function(){ return 'test';});
Second, please check if your server is heavy (Apache or Nginx) write rules conform to laravel rules
Third, why not just use PHP artisan serve?
IV: I recently online community, free video tutorial: https://laravist.com/have laravel related questions can come here to ask me, almost all day waiting. haha haha