0
                              /*edit.blade.php*/
                                    <div class="form-group ">
                                      <p>{{Form::label('Status', 'Κατάσταση :')}} 

                                    Άριστη {{Form::radio('status', 'Άριστη')}}
                                    Καλή {{Form::radio('status', 'Καλή')}}
                                    Μέτρια {{Form::radio('status', 'Μέτρια')}}
                                    Κακή {{Form::radio('status', 'Κακή')}}</p>
                                   </div>

/*when the user click to edit posts i want the radio button remember the previous option that given by a user */

user2094178
  • 9,204
  • 10
  • 41
  • 70
crazyworld
  • 11
  • 7
  • Pass the current values as an array to your blade view and set them by setting the `value` in the radio button. https://stackoverflow.com/a/39524462/3585500 – ourmandave Sep 02 '18 at 21:03

1 Answers1

0

When creating a new resource you can achieve what you want with this construct:

{{ Form::radio('status', 'Άριστη', old('status') == 'Άριστη') }}

You can also add a second parameter to old() and reuse it when editing an existing resource entry:

{{ Form::radio('status', 'Άριστη', old('status', $resource->status ?? '') == 'Άριστη') }}
user2094178
  • 9,204
  • 10
  • 41
  • 70