1

my controller

public function basicSettingStore(Request $request){
    $validator = Validator::make($request->all(),[
        'appid' => 'required',
        'appsecret' => 'required',
        'token' => 'required'
    ]);

    if($validator->fails()){
        return redirect('weChat/basicSetting')->withErrors($validator);
    }

my routes

Route::group(['middleware' => ['auth']], function () {...

If the Route has 'web' middleware,the errors will be empty in view.But,if I remove it,the errors will be ok in view.

Can someone help me to access errors from $errors variable in my blade view? Thanks!

SoulKeep
  • 35
  • 3

1 Answers1

2

Since 5.2.27 you have to remove web middleware from routes.php, because it's now added to all routes in this file automatically. If you add it manually, you can have problems with sessions, errors bag etc. Please read more on it here.

Community
  • 1
  • 1
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279