I am trying to create a resource route in Laravel for my controller which is inside app\controllers\FormController. How can I do this? I tried in the following ways but none of them worked.
Router::resource('form', 'app\controllers\FormController');
Router::resource('form', 'app\\controllers\\FormController');
Router::resource('form', 'app/controllers/FormController');
namespace app\controllers;
class FormController extends BaseController {
public function index()
{
return View::make('hello');
}
}
If I remove the namespace, it works.
Result:
ReflectionException (-1)
Class app\controllers\FormController does not exist