Laravel: columnize() 必须是array, string given, called in 类型

Laravel: columnize() must be of the type array, string given, called in

我想在更新记录时调用此查询而不是 ID,但我收到一条错误消息说 columnize() 必须是数组类型,给定的字符串,在 中调用

$user = Attendances::find(DB::raw('concat (firstname, " ",lastname)'), 'like', Input::get('student_name'))->where('section_name', 'like', Input::get('section_name'))->where('teacher_id', '=', Auth::user()->id)->where('subject_code', 'like', Input::get('subject_code'));

请帮忙:(

第一种方法也应该是where(),因为find()只适用于主键。最后还应该调用 get()first() 来执行查询:

$user = Attendances::where(DB::raw('concat (firstname, " ",lastname)'), 'like', Input::get('student_name'))
       ->where('section_name', 'like', Input::get('section_name'))
       ->where('teacher_id', '=', Auth::user()->id)
       ->where('subject_code', 'like', Input::get('subject_code'))
       ->first();