mercredi 6 avril 2016

Laravel radio button name not showing in input request when radio button nothing selected

{!!Form::text('first_name','')!!}
{!!Form::text('last_name','')!!}

{!!Form::radio('status','1')!!}
{!!Form::radio('status','2')!!}

Above radio button nothing selected, when submit the input to controller,

public function store(Request $request)
{
    $inputArray = $request->all();
    echo "<pre>";
    print_R($inputArray);
    exit;
}

Below are the response for the input array:

Array
(
    [_token] => 0yavNy0XLB7YM4xSnKFR7LZqfwTqkybBum3tnkJQ
    [first_name] => 
    [last_name] => 
)

Why the radio input name(status) does not shows in request. I want the below response.

Array
(
    [_token] => 0yavNy0XLB7YM4xSnKFR7LZqfwTqkybBum3tnkJQ
    [first_name] => 
    [last_name] => 
    [status] =>
)

Please help. Thanks in Advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire