mardi 14 février 2017

Prefill input text with LaravelCollective

I have a Laravel 5.2 application, I have a form with a lot of elements (checkboxes,selects, inputs file, input text, etc). So, I'm using the Form & HTML extension of LaravelCollective So, I'm using form::model to bind the model to the form, that's working great with all the elements except with the input text, and a email element. I have this:

{!! Form::model($mymodel,array('url'=>'myurl','method'=>'POST')) !!}
    {!!  Form::email('mail', $value = null, $attributes = array('class'=>'form-control')) !!}
    {!! Form::text('Username', '', array('class' => 'form-control')) !!}
{!! Form::close() !!}

Then, listing the attributes that I have in the model (I made dd($mymodel) and copied only the fillable):

array:25 [▼
    0 => "mail"
    1 => "Username"
  ]

The others attributes are prefilled properly, except input text and input mail.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ldWu7T
via IFTTT

Aucun commentaire:

Enregistrer un commentaire