Laravel MessageBag errors array is empty in view but with content if I kill script

后端 未结 5 517
太阳男子
太阳男子 2020-12-21 13:32

I am trying to return errors back to my view, this is part of my controller TestcategoryController

    $rules =array(
        \'name\' => \'required\'
            


        
5条回答
  •  情歌与酒
    2020-12-21 14:14

    I was having the same problem with Laravel 8.0

    The only way I could solve this was by entering the error bags layer by layer until I got to the messages manually:

    @if (count($errors->getBags()))
        
      @foreach ($errors->getBags() as $bag) @foreach ($bag->getMessages() as $messages) @foreach ($messages as $message)
    • {{ $message }}
    • @endforeach @endforeach @endforeach
    @endif

提交回复
热议问题