Laravel ::在此服务器上找不到请求的资源/ hello
问题描述:
当我将.php文件更改为.blade.php时出现错误。 在我改变它之前得到了这个错误。Laravel ::在此服务器上找不到请求的资源/ hello
Route::get('hello','[email protected]');
HelloController中
public function index()
{
$data = array(
'name' => 'Rakesh',
'email' => '[email protected]');
return View::make('hello.index')->with('data', $data);
}
/public/hello/index.blade.php
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Laravel 5.3 - Home page</title>
</head>
<body>
<h1>Welcome Hello index </h1>
<h1>{!!$data!!}</h1>
<h1>{!!$data['email']!!}</h1>
</body>
</html>
错误
The requested resource /hello was not found on this server.
答
的观点应该是resources/views
文件夹,而不是当您创建具有相同的名称作为路线的公共文件夹中的文件夹,请改变你已经把在该文件夹的名称,则会出现该错误public
文件夹
答
内公共文件夹,以便它有一个不同于你的路线名称,这可能会解决你的错误
非常感谢,这是我的错。我在YouTube上看到视频,并跟着他。 –
这是工作。谢谢 –