2016-12-24 7 views
2

.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. 

答えて

5

は、ビューには、あなたがに入れているフォルダの名前を変更してください、あなたのルートと同じ名前のパブリックフォルダにフォルダを作成するときにエラーが発生しresources/viewsフォルダの代わりに、publicフォルダ

+0

ありがとう、それは私のせいです。私はyoutubeのビデオを参照してください。 –

+0

それは仕事です。ありがとう –

1

内にある必要があります公共のフォルダにあなたのルートとは異なる名前を持つようにすると、これはおそらくあなたのエラーを解決するでしょう

関連する問題