类Frontend \ Auth \ LoginController不存在

时间:2018-07-09 17:26:29

标签: laravel laravel-authentication

我开始将Laravel项目形式从v5.2升级到v5.6。我遵循了该文档,并在那里进行了更改。现在,作曲家更新适用于5.6版本。在项目中,身份验证是通过Sentry进行管理的,我计划将其替换为Laravel默认身份验证和spatie / laravel-permissions软件包来管理角色权限。

我导入了软件包,并添加了控制器和路由。但是问题是我在访问/login路由Class Frontend\Auth\LoginController does not exist

时遇到以下错误

我找不到出现此错误的原因。我的路线定义如下,

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', 'LoginController@logout')->name('logout');
        });

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

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

            // Registration routes
            Route::get('register', 'RegisterController@showRegistrationForm')->name('register');
            Route::post('register', 'RegisterController@register')->name('register.post');

            // Password Reset Routes
            Route::get('password/reset', 'ForgotPasswordController@showLinkRequestForm')->name('password.email');
            Route::post('password/email', 'ForgotPasswordController@sendResetLinkEmail')->name('password.email.post');

            Route::get('password/reset/{token}', 'ResetPasswordController@showResetForm')->name('password.reset.form');
            Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset');
        });
    });

});

我的升级项目的源代码可在https://gitlab.com/nasirkhan/doptor/tree/nasirkhan

获得

0 个答案:

没有答案