Support the ongoing development of Laravel.io →
posted 10 years ago
Forms

hi, I am using illuminate/html and laravel5 i have a form for a profiles page, and have want to use a $table->enum field for the data.

here is what the code looks like for the select.

                <div class="form-group">
                    {!! Form::label('gendertest','Gender',['class' => 'control-label']) !!}
                    {!! Form::select('gendertest',['unknown','Male','Female'],null, ['class' => 'form-control
                    input-sm','placeholder' =>
                    'What is your gendertest?']) !!}
                </div>

how can i bind the value from the database using the enum as in the database if i select option 1 which is male, male is set in the database, so when i retrieve male from the database i cant then select that, how can i do this?

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

oisian oisian Joined 19 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.