N
N
Northern Lights2019-11-22 12:43:10
Laravel
Northern Lights, 2019-11-22 12:43:10

By what principle are model values ​​bound to form fields?

It became interesting ..
The model has a type_id
attribute. In the view, I bind the model to the form

{{ html()->modelForm($document, 'PATCH', route('admin.docflow.document.update.main', $document->id))->class('form-horizontal')->open() }}

and the text field itself is simply called type :
{{ html()->text('type')
 ->class('form-control')
 ->attribute('maxlength', 256)
 ->required() }}

the binding happened - the value from the model was put down in the form field. I looked at the source code, I can not quickly find something. Maybe someone knows the principle?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question