Laravel 5.3 - htmlspecialchars() expects parameter 1 to be string

前端 未结 3 1546
执笔经年
执笔经年 2020-12-06 11:38

I am new to laravel and I am enjoying it. While working on a social media project I got this error: htmlspecialchars() expects parameter 1 to be string, object given (

3条回答
  •  眼角桃花
    2020-12-06 12:18

    I was getting this because in my view I was using $errors->get('username') to show errors but get() returns an array. Switching to $errors->first('username') fixed this.

提交回复
热议问题