Laravel控制器错误 - 类不存在

时间:2015-02-19 19:00:29

标签: php laravel

<?php 

namespace App\Http\Controllers;

class FormContoller extends Controller
{
  public function add(){
  $item = new App\Item;
  //Some random code with the $item class
  return redirect('success');
  }
}

这是我的Routes.php

Route::post('add','FormController@add');

此外,控制器的名称为 - &#34; FormController&#34;。我猜没有错误。

但是,我收到以下错误......

  

Container.php第776行中的ReflectionException:   类App \ Http \ Controllers \ FormController不存在

我是初学者。请帮忙!

提前致谢

1 个答案:

答案 0 :(得分:2)

你是FormContoller,而是在Routes.php中说FormController - 有两个r。

干杯,

相关问题