Support the ongoing development of →
Configuration Requests Architecture
Last updated 2 years ago.

I could be wrong, but as the Composer PSR-0 autoloader converts underscores to sub folders, unless your Base_Controller is called Controller and is in a folder called Base, it may not autoload.

Try using StudlyCaps and see how you go.

You also need to reference the controller name in the route:

Route::get('/', array('as'=>'home', 'uses'=>'QuestionsController@index'));

And any reason you don't just have a straight index() method?

You seem to want to over-complicate things. Keep it simple (forget named routes, your own ideas, etc) and follow the conventions laid out in the docs.

If in doubt, use artisan to create your resful controller:

php artisan make:controller QuestionsController
Last updated 9 years ago.

Thanks Dave! As I said, I'm new to Laravel. So if I tend to over-complicate things; that is because I lack experience. Anyway using the Artisan command in the terminal fixed the issue. However I noticed, Laravel extends to Controller and not BaseController in the file they've created for me. I guess things have changed in the new version.


No probs, glad to help. I'm also new to Laravel, but luckily not PHP or frameworks :)

You can simply modify the code if you want to extend from a superclass. Laravel's autoloading (I presume, just a PHP autoloader) should find it.

Read up on namespacing, as the namespaces will map to folders!

Good luck :)


I will do so. Once again thanks for the suggestions. :)


Sign in to participate in this thread!


Your banner here too?

devKhairul devkhairul Joined 28 Apr 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.