【发布时间】:2015-08-17 20:12:10
【问题描述】:
这是我的路线:
Route::get('/', 'WelcomeController@index');
Route::get('home', 'WelcomeController@index');
Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);
这是我的 WelcomeController:
<?php namespace App\Http\Controllers;
class WelcomeController extends Controller {
/*
|--------------------------------------------------------------------------
| Welcome Controller
|--------------------------------------------------------------------------
|
| This controller renders the "marketing page" for the application and
| is configured to only allow guests. Like most of the other sample
| controllers, you are free to modify or remove it as you desire.
|
*/
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Show the application welcome screen to the user.
*
* @return Response
*/
public function index()
{
return view('welcome');
}
}
视图很简单..
我输入 /home 的结果是这样的:
为什么我做错了?
与 Apache/xampp 有关吗?我只是不知道..我在主文件夹中再次安装了作曲家,没有任何改变。
所以,如果有人可以帮助我,我会很高兴
【问题讨论】:
-
您是否创建了虚拟主机?把你的 htaccess 文件也放上。
-
就像@itachi 提到的那样。检查您的 htaccess 设置。从您的 URL 手动下降到公共目录,通常将您的虚拟主机设置为指向公共目录,而不是像这样访问公共,因为您正在公开您的应用程序根目录
-
添加路由后有没有尝试清除路由缓存? (php artisan route:clear)
标签: php apache laravel routes laravel-5