SetKyarWaLar's avatar

Class 'App\Http\Controllers\Controller' not found

I try to upgrade Laravel 4 to 5 base from Laravel Doc and I got Class 'App\Http\Controllers\Controller' not found error in my AuthController. What I was wrong on here?

PS:: I already added namespace App\Http\Controllers; to the top of my controller and yeah already composer dumpautoload

Any idea?

0 likes
8 replies
Boris56's avatar

Try this : namespace App\Http\Controllers\Auth; in AuthController.

2 likes
zachleigh's avatar

Is the parent contoller, Controller, properly namespaced?

davorminchorov's avatar

Did you write use App\Http\Controllers\Controller; at the top of the file?

3 likes
AtomicRSA's avatar

Run php artisan route:list and check if auth shows up on the list. I think it is a good place to start.

AbdulJamil's avatar

I know the post is older but I just had the same problem and the following fixed the issue for me.

For example, if your application is named "blog", you could run the following command from the root of your installation:

php artisan app:name blog

and then use the name space 'blog\Http\Controllers\Controller' and it fixed my issue.

2 likes
joelmez4's avatar

It work like a charm use App\Http\Controllers\Controller;

1 like

Please or to participate in this conversation.