CodeIgniter 4 Construtora de consulta ser inserida ID
$query = $this->db->table($this->table)->insert($data);
return $query->resultID;
Friendly Flamingo
$query = $this->db->table($this->table)->insert($data);
return $query->resultID;