I try do a model binding in edit.blade.php however, fieldname in database host_firstname is different from fieldname of Form host-firstname
So, the data from database not show in the field when we run. (and I don't want to change data field-name in my view too)
I'm very new to Laravel and I'm not sure how to set default keyname in model to make it works. Does anybody has any solutions for this?
Database Schemas
family_general_id int(10) unsigned NOT NULL AUTO_INCREMENT,
host_firstname varchar(255) COLLATE utf8_unicode_ci NOT NULL,
host_lastname varchar(255) COLLATE utf8_unicode_ci NOT NULL,
edit.blade.php
{!! Form::model($survey, ['method' => 'PATCH', 'url' => 'surveys/' . $survey->family_general_id]) !!}
<!-- Host-firstname Form Input-->
<div class="form-group">
{!! Form::label('host-firstname', 'Firstname:') !!}
{!! Form::text('host-firstname', null, ['class' => 'form-control']) !!}
</div>
<!-- Host-lastname Form Input-->
<div class="form-group">
{!! Form::label('host-lastname', 'Lastname:') !!}
{!! Form::text('host-lastname', null, ['class' => 'form-control']) !!}
</div>
{!! Form::close() !!}