How can I add a field in Entityform / hook_form_alter
That is the way it should be done.

For example using

MODULE_form_ENTITYFORM_MACHINE_NAME_entityform_edit_form_alter(&amp;$form, &amp;$form_state) {}