Laravel :: 在此服务器上找不到请求的资源 /hello

Laravel :: The requested resource /hello was not found on this server

我将 .php 文件更改为 .blade.php 时出现错误。 在我更改之前出现此错误。

Route::get('hello','HelloController@index');

HelloController

public function index()
    {
      $data = array(
    'name'  => 'Rakesh',
    'email' => 'sharmarakesh395@gmail.com');
      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 文件夹

当您在 public 文件夹中创建与您的路线同名的文件夹时会发生该错误,因此请更改您放入 public 文件夹中的文件夹的名称,以便它与您的路线名称不同这可能会解决您的错误