ErrorBag is always empty in Laravel 5.2

后端 未结 3 1949
天涯浪人
天涯浪人 2020-11-30 15:38

I was creating a new Laravel project and when debugging the errors of a form request, I noticed that my ErrorBag was always empty. Even when in the controller $validat

3条回答
  •  悲哀的现实
    2020-11-30 16:15

    Are you triggering any form validation errors? If you are then try this -

    $messages = $validator->errors();
    

    The messages variable should now have your errors

    If you error bag is still empty

    • Check if your post data are being posted to the proper route/controller

提交回复
热议问题