Working on a project that includes an old database that has too many dependencies to ever change names for the fields. But in my new code I'd like to refer to the fields and hence names of the form input fields by different names that are more standard. The problem with this is that the automatic Laravel form model binding then has no idea where to put the values from the fields.
I was sure that there was better documentation on this, but currently this is all I can find. https://laravelcollective.com/docs/5.2/html#form-model-binding
So here would be an example of the problem:
An Order table that has fields such as 'first_name', 'last_name', 'cell', 'cc_number', 'billing_schedule', etc.
And a new order form that has input names such as 'full_name', 'cell_phone', 'credit_card_number', 'annual_monthly', etc.
So when I have these conflicting names and I use:
{!!Form::model($order,['action' => 'order@update'])!!}
Any form input names that don't match their corresponding database field names are left blank when editing the form.
Is there any way to alter the Order model to allow for this discrepancy? I know I can edit the Order model to match up with a different table just by setting the protected $table variable. Just wondering if there was some similar approach to fixing this problem.