vendredi 21 août 2015

Laravel 5 get select option value

in my create function, I do

$clients = Client::lists('clientName');
return View::make('projects.create', compact('clients'));

In my View, I then populate the select by doing this

 {!! Form::select('clientName', $clients, Input::old('clients'), ['class' => 'form-control']) !!}

When I view the html, I see something like the following

<select name="clientName" id="clientName" class="form-control">
    <option value="0">John Dandy</option>
</select>

Now in my store function, I need to get the value John Dandy, not 0. If I do

$clientName = Input::get('clientName');

I get 0. How can I set the value to the clientName or get the option in my store function?

Thanks



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

Aucun commentaire:

Enregistrer un commentaire