Level 16
No Form method. try adding
method="put or patch" to the form
//and add the method field
{{method_field('post)}}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Quiz app,I am trying to submit a form with a model named question along with a hasmany relation to its choices(choice) be updated. But its going to blank I tried using named routes and url.
<form action="{{route('question.update',$question->id)}}">
{{csrf_field()}}
<ul>
<label for="{{$question->question}}">Title</labe>
<input type="text" name="{{$question->question}}" value="{{$question->question}}">
@foreach ($question->choice as $choice)
@if($choice->is_correct == 1)
<li> Correct:<input type="text" value="{{$choice->text}}"></li>
@else
<li><input type="text" value="{{$choice->text}}"></li>
@endif
@endforeach
</ul>
<input type="submit">
</form>
should be getting a dd
public function update(Request $request, $id)
{
dd("we got to question controller update");
}
Please or to participate in this conversation.