'100' . mt_rand(1000, 9999) . mt_rand(1000, 9999), 'password' => HashHelper::make(Str::random(10)), 'is_robot' => 1 ]); $robot = Robot::create([ 'user_id' => $user->id, 'robot_name' => $data['robot_name'], 'describe' => $data['describe'], 'logo' => $data['logo'], 'is_talk' => $data['is_talk'], 'status' => 0, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s'), ]); Db::commit(); } catch (\Exception $e) { Db::rollBack(); return false; } return $robot->toArray(); } }