<?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');
}
}
Here's my Routes.php
Route::post('add','FormController@add');
Also, the controller has the name - "FormController". No errors there, I guess.
But, I get the following error...
ReflectionException in Container.php line 776: Class App\Http\Controllers\FormController does not exist
I'm beginner. Please help out!
Thanks in advance
./controllers/http/and if so, shouldn't the namespace beApp\Controllers\Http?