As discussed in chat , you will be using the same form on both the registration page and the edit page. On the registration page, you want the third parameter of Form::select
to be null
, because the user has not yet selected any value. Already on the edit page, you want this third parameter to be the value of $coupon->cupUnic
, which is the value stored in the database. Considering that you are using PHP 7, as also said in chat, you can use the null coalescer operator to return the value of the variable, if it is set, or null
otherwise.
$coupon->cupUnic ?? null
In your case, Form::select
would be:
{!! Form::select('cupUnic', ['' => 'Selecione', '1' => 'Sim', '2' => 'Não'], $coupon->cupUnic ?? null, ['class'=>'form-control', 'parsley-trigger'=>'change', 'required'=>'required']) !!}