vincej's avatar
Level 15

Why does "BaseController" fail and "Controller" Does not ?

Weird or what - the docs say I should extend "BaseController" BUT, if I do so, I get an error: Class 'BaseController' not found.

If however, I extend "Controller" everything works.

Have I broken my system or are the Docs wrong ?

Many Thanks !

0 likes
2 replies
bestmomo's avatar

Hello,

Is the BaseController.php file still in app/controllers directory ?

vincej's avatar
Level 15

I think I found the error and of course it is my error.

Laravel gives you out of the box a BaseController:

class BaseController extends Controller{
}

Now, if you are dozy like me and you accidentally change it to

class MyController extends Controller{ }

Then indeed the system can not find "BaseController" ... it does not exist ... but of course Controller does exist.

Changing it back fixed the problem.

Many Thanks !

Please or to participate in this conversation.