Daroath
Daroath

Reputation: 382

how to populate enum value in mysql with laravel 4.1

I'm new to Laravel, but now I want to populate the value that I set as enum in MySQL database to a select box using Laravel 4 for my Schema like below

$table->enum('user_type', array('premium','free','agent free','agent premium'));

Upvotes: 2

Views: 2126

Answers (1)

giannis christofakis
giannis christofakis

Reputation: 8321

Here is the reference on the doc.

{{ Form::select('user_type',
                array( 'premium' => 'premium', 'free' => 'free','agent free' => 'agent free', 'agent premium' => 'agent premium'),
                $user->user_type) }}

Upvotes: 2

Related Questions