Back

Error on Auth Routes, Class Frontend\Auth\LoginController do


I started to upgrade a Laravel project form v5.2 to v5.6. I followed the doc and made the changes listed there. now the composer update is working for 5.6 version. On the project the Authintication was managed via Sentry and i planned to replace that with Laravel default auth and spatie/laravel-permissions package to manage role-permissions.

I imported the package and added the controllers and routes. But the problem is i am getting the following error while accessing the /login route, Class Frontend\Auth\LoginController does not exist

I could not find the reason of getting such error. my route is defined as the following,

Route::group(['namespace' => 'Frontend', 'as' => 'frontend.'], function () {
    // includeRouteFiles(__DIR__.'/Routes/');

    /**
     * Frontend Access Controllers
     * All route names are prefixed with 'frontend.auth'.
     */
    Route::group(['namespace' => 'Auth', 'as' => 'auth.'], function () {

        /*
        * These routes require the user to be logged in
        */
        Route::group(['middleware' => 'auth'], function () {
            Route::get('logout', '[email protected]')->name('logout');
        });

        /*
         * These routes require no user to be logged in
         */
        Route::group(['middleware' => 'guest'], function () {
            // Authentication Routes
            Route::get('login', '[email protected]')->name('login');
            Route::post('login', '[email protected]')->name('login.post');

            // Socialite routes
            Route::get('login/{provider}', ['as' => 'social.login', 'uses' => '[email protected]']);
            Route::get('login/{provider}/callback', '[email protected]');

            // Registration routes
            Route::get('register', '[email protected]')->name('register');
            Route::post('register', '[email protected]')->name('register.post');

            // Password Reset Routes
            Route::get('password/reset', '[email protected]')->name('password.email');
            Route::post('password/email', '[email protected]')->name('password.email.post');

            Route::get('password/reset/{token}', '[email protected]')->name('password.reset.form');
            Route::post('password/reset', '[email protected]')->name('password.reset');
        });
    });

});

the source code of my upgraded project is available at https://gitlab.com/nasirkhan/doptor/tree/nasirkhan

Peace-N replied 2 months ago

Please run php artisan route:list and on this controller could I see the namespace Frontend\Auth\LoginController and also your composer.json


Sign in to participate in this thread!



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