我正在用laravel 5.8开发一个应用程序。在我的应用程序中,如果用户没有完成100%的配置文件,我尝试强制将经过身份验证的用户重定向到配置文件页面。我在users表中有一个profile_completed列,在那里我跟踪配置文件的完成百分比。因此,如果用户尝试去其他路线,它会将他们重新定向回个人资料页面。以下是我的路线:
Auth::routes(['verify' => true]);
Route::group(['middleware' => ['verified']], function() {
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/profile_page', 'HomeController@profilePage')->name('profile_page');
Route::get('/edit_profile', 'HomeController@editProfile')->name('edit_profile');
Route::post('/update_personal_info', 'HomeController@updatePersonalInfo')->name('update_personal_info');
Route::post('/update_business_info', 'HomeController@updateBusinessInfo')->name('update_business_info');
});现在我没有任何想法,我应该在哪里做,如何做。有人能帮我吗?
发布于 2019-06-05 18:07:32
成功登录后,您必须检查登录页面方法中的百分比,如果配置文件未完成,您可以从那里重定向到配置文件页面。
https://stackoverflow.com/questions/56441293
复制相似问题