#StackBounty: #magento2 What is the correct way to modify core column value in Magento 2?

Bounty: 50

I’ve a requirement to remove firstname, lastname as required field from registration page which I can achieve by modifying eav_attribute table directly

UPDATE 'eav_attribute' SET 'is_required' = 0 WHERE 'entity_type_id' = 1 && 'attribute_code' = 'lastname';

(Similarly I’ll update firstname and remove firstname, lastname input field from phtml file.)

I know modifying core tables directly is not a good practice. What are other alternatives through which I can achieve above requirement?

After reading Modify core tables vs custom tables and joins, I see it’s recommended to create custom table and use joins . Can someone share any example how that is done ?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.