5.4用
'last_user_id' => $faker->randomElement($user_ids)
会报Illuminate\Database\QueryException with message 'PHP error: Array to string conversion..是因为 randomElement 函数返回的是数组,改成下面就可以了
Illuminate\Database\QueryException with message 'PHP error: Array to string conversion..
randomElement
'last_user_id' => ($faker->randomElement($user_ids))[0],