Laravel get id of a radio input

Viewed 32

i want to get the value of id input after i submit the Form in Laravel. This is my code. How i can get the id in the controller?

here the code of the view

<form action="{{url('erledigt')}}" name="erledigt" id="erledigtID" method="post">
@csrf   
     <input class="field" type="radio" id="1" name="name" value="value1">
     <label for="1">value1</label><br>
    
     <input class="field" type="radio" id="2" name="name" value="value2">
     <label for="2">value2</label><br>
    
     <input class="field" type="radio" id="3" name="name" value="value3">
     <label for="3">value3</label><br>
<form>   

the route

Route::post('erledigt', [todoController::class, 'finishen']);

Here the the function of the controller

public function finishen(Request $request)
        {   
            $post = new Post;
            $post=$request->name;
            return redirect('/')->with('status', $post );
    }
0 Answers
Related