I read about model form binding https://laravelcollective.com/docs/5.0/html#form-model-binding
It is very convenient to fill in the DB values ββin html form. I tried this and it works fantastic.
{{ Form::model($university,array('url' => admin_path('universities/edit'),'id' => 'add_university','name' =>'add_university','data-validate'=>"parsley")) }} {{ Form::label('university_name', 'University name',array('class'=>'control-label')) }} {{ Form::text('university_name')}} {{Form::close()}}
But the problem is here, because I want to add more attributes to the input, like class CO, I use
{{ Form::label('university_name', 'University name',array('class'=>'control-label')) }} {{ Form::text('university_name','',array('class' => 'form-control'))}}
If I leave an empty value column, then nothing will be filled in the text box, and if I use like this
{{ Form::label('university_name', 'University name',array('class'=>'control-label')) }} {{ Form::text('university_name',$university->university_name,array('class' => 'form-control'))}}
Then what is the use of model binding. Please explain. Thanks
source share