2017-01-22 8 views
0

私はLaravelフレームワークを学習しており、簡単なプロジェクトを作成しました。Route.php行のReflectionException:関数()が存在しません理由がわからない

これは私のコードです:

index.blade.php

web.php

Route::get('/', function() { 
return view('welcome'); 
}); 

Route::get('/people', ['uses' => '[email protected]']); 

PeopleController.php

class PeopleController extends Controller 
{ 
public function index() 
{ 
    $users = [ 

     '0' =>[ 
      'first' => 'Alex', 
      'last' => 'Shifu', 
      'location' => 'Gotham' 
     ] 
    ]; 

    return view('people.index' , compact('people')); 
} 
} 

RouteCollection.phpライン161に()オブジェクト(リクエスト) RouteCollection->試合でRouter.phpライン766に Router-> findRoute(時:

@foreach($people as $peep) 
    <li>{!! $peep['first'] !!}</li> 
@endforeach 

これらは、私が直面していますエラーですのRouter-> dispatchToRoute(object(Request)) のルータ - >ディスパッチ(オブジェクト(Request)) のKernel.php行268のRouter.php行607のRouter.php行621のルータ - > Illuminate \ Foundation \ Http {closure}(オブジェクト(リクエスト)) パイプライン.php 53 at パイプライン - >イルミネーション\ルーティング{closure}(オブジェクト(リクエスト) )in CheckForMaintenanceMode.php 46行目 CheckForMaintenanceMode-> handle(オブジェクト(リクエスト)、オブジェクト(クロージャ)) のパイプライン.php 137行 のパイプライン - >イルミネート\パイプライン{クロージャ}(オブジェクト(要求))in Pipeline.php 33行目のPipeline-> Illuminate \ Routing {closure}(オブジェクト(要求))Kernel.phpのPipeline-> then(オブジェクト(Closure)) Kernelの150行目 - > sendRequestThroughRouter(object(Request))in Kernel.phpの117行目(index.phpのKernel-> handle(object)) line 54 at require_once( 'C:\ wamp64 \ www \ MyApp \ public \ index .php ')in server.php line 21

答えて

0

唯一の問題は、index()メソッドで$ usersを$ peopleに変更する必要があることです。

それ以外はすべてうまく見えます。

関連する問題