I am newbie to Laravel namespaces.
I am trying to do something like this:
namespace App\Controllers; // when I remove this line, everything works fine... I need to include this
class HomeController extends BaseController {
protected $layout = "layouts.main";
public function __construct() {
// some stuff here
}
/**
* Home page.
* @return View
*/
public function getHome() {
// Show the page
$this->layout->content = View::make('home');
}
}
But I am having this weird error,
Class HomeController does not exist
Here is some of my composer.json stuff,
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/libraries",
"app/models",
"app/database/migrations",
"app/database/seeds",
]
},
I have also executed,
composer dump-autoload
While I am routing something like this,
# Default
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@getHome'));