I have this bit in my view,
<div class="form-group">
<label for="theme" class="col-sm-3 control-label">Theme</label>
<select class="form-control" id="theme" name="theme">
<option value="0">Default Theme</option>
<option value="1">Dark Theme</option>
</select>
</div>
and in my controller
/**
* Change User Account Settings
*
* @access public
* @return view user.settings
*/
public function changeSettings($username, $id)
{
$user = Auth::user();
if (Request::isMethod('post')) {
$user->style = (int) Request::get('theme');
$user->save();
return Redirect::route('profil', ['username' => $user->username, 'id' => $user->id])->with(Toastr::success('Your Account Was Updated Successfully!', 'Yay!', ['options']));
} else {
return redirect()->back()->with(Toastr::warning('Something Went Wrong!', 'Error', ['options']));
}
}
how can I make it so the option selected value defaults to what style the user has selected in the DB?