Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class App\Http\Controllers\AuthController does not exist Laravel 5.2

My whole application, made in Laravel 5.2, is working perfectly fine but when i tried to get list of routes through following command:

php artisan route:list

It shows me following error:

[ReflectionException] Class App\Http\Controllers\AuthController does not exist

i tried to add namespace aswell:

Route::group(['middleware' => ['web'], 'namespace' => 'Auth'], function () {
    Route::auth();
});

then it shows me following error:

[ReflectionException]
Class App\Http\Controllers\Auth\Auth\AuthController does not exist

My routes file is:

Route::group(['middleware' => ['web'], 'namespace'=>'Auth'], function() {
     Route::auth(); 
});

Update: content of Router.php

public function auth()
{
    // Authentication Routes...
    $this->get('login', 'Auth\AuthController@showLoginForm');
    $this->post('login', 'Auth\AuthController@login');
    $this->get('logout', 'Auth\AuthController@logout');

    // Registration Routes...
    $this->get('register', 'Auth\AuthController@showRegistrationForm');
    $this->post('register', 'Auth\AuthController@register');

    // Password Reset Routes...
    $this->get('password/reset/{token?}', 'Auth\PasswordController@showResetForm');
    $this->post('password/email', 'Auth\PasswordController@sendResetLinkEmail');
    $this->post('password/reset', 'Auth\PasswordController@reset');
}

Please help! Thanks

like image 924
Awn Ali Avatar asked Mar 22 '16 08:03

Awn Ali


2 Answers

I cannot comment so I'm going to ask have you run php artisan make:auth and with laravel 5.2 you dont need your routes in your Routes.php. All you have to have in your href="{{ url('/login') }}"

like image 59
Skel Avatar answered Oct 20 '22 21:10

Skel


in my case just remove:

     'namespace' => 'App\Http\Controllers',

namespace => App\Http\Controllers

like image 29
saber tabatabaee yazdi Avatar answered Oct 20 '22 22:10

saber tabatabaee yazdi