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

后端 未结 5 515
太阳男子
太阳男子 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:04

    Probably another issue would be with $errors not being saved to Session variable $errors and nothing being shown in the view.

    Here is an example of the same issue: http://laravel.io/forum/03-28-2016-errors-variable-empty-after-failed-validation

    For me the solution defined in the above link worked. Solution: Is in app\Http\Kernel.php Move \Illuminate\Session\Middleware\StartSession::class, from $middlewareGroups to $middleware

    Before

    After

提交回复
热议问题