Reputation: 39
I use laravel 5.4.
<select name="type" id="type">
<option value="0">title1</option>
<option value="1" selected>title2</option>
<option value="2">title3</option>
</select>
I record the data to the database. But I can not get the value of the select box tag. I am using the following codes in Controller and as a result I get text.
$type = $request->get('type');
or
$type = Input::get('type');
print_r($type) ;
result: "title2"
I did not find any results in my research. Please help me.Is there a recommendation?
Upvotes: 1
Views: 9781
Reputation: 307
the easiest way is $request->type
to get value of select option in your controller ;)
Upvotes: 0