Php 缺少[Route:questions.update]的必需参数在url中传递2个参数

Php 缺少[Route:questions.update]的必需参数在url中传递2个参数,php,laravel-7,Php,Laravel 7,伙计们,我在文件web.phpurl中传递两个参数时遇到问题 public function edit(Exam $exams, Question $questions, Category $category){ return view('question.edit', compact( 'exams' ,'questions', 'category')); } public function update(QuestionUpdateRequest $req

伙计们,我在文件
web.php
url中传递两个参数时遇到问题

 public function edit(Exam $exams, Question $questions, Category $category){
        return view('question.edit', compact( 'exams' ,'questions', 'category'));
    }

    public function update(QuestionUpdateRequest $request, $id){
        $questions = Question::find($id);
        $questions->description = $request->get('description');
        $questions->iframe = $request->get('iframe');
        $questions->image = $request->get('image');

        $questions->exam_id = $request->get('exam_id');
        $questions->category_id = $request->get('category_id');
        $questions->save();
        return redirect()->route('question.index', $questions->exam_id);
    }
那是我的错误

我曾经

Route::resource('/tests/{test}/questions','Backend\QuestionController')

定义默认路线

在终端中,看起来像:

|        | PUT|PATCH | exams/{exam}/questions/{question}      | questions.update   | App\Http\Controllers\Backend\QuestionController@update                 | web        |
|        |           |                                        |                    |                                                                        | auth       |
|        | DELETE    | exams/{exam}/questions/{question}      | questions.destroy  | App\Http\Controllers\Backend\QuestionController@destroy                | web        |
|        |           |                                        |                    |                                                                        | auth       |
|        | GET|HEAD  | exams/{exam}/questions/{question}/edit | questions.edit     | App\Http\Controllers\Backend\QuestionController@edit                   | web        |
|        |           |                                        |                    |                                                                        | auth       |
要重定向,它是这样写的

<a href="{{ route('questions.edit', [ $exams->id, $question->id ]) }}"class="btn btn-warning btn-sm"><i class="far fa-edit"></i></a>
但是如果我已经在传递url指示的参数,我不理解为什么它会失败

同时添加编辑视图

<form action="{{ route('questions.update', $questions->id ) }}" method="POST" enctype="multipart/form-data">
   {{--/exams/{{$exams->id}}/questions--}}
    <div class="form-group">
        {{--<input type="hidden" name="question_id" value="{{$questions->id}}">--}}
        <label for="description">Descripcion de la pregunta*</label>
        <textarea name="description" type="text"
                  class="form-control" id="description"
                  aria-describedby="descriptionHelp"
                  placeholder="Inserte la pregunta">{{ old('description', $questions->description) }}</textarea>
        <small id="descriptionHelp"
               class="form-text text-muted">Escribe la descripcion de la pregunta.</small>
    </div>
    <div class="form-group">
        <label for="iframe">Video asociado *</label>
        <textarea name="iframe" type="text"
                  class="form-control" id="iframe"
                  aria-describedby="iframeHelp"
                  placeholder="Inserte la URL del video">{{ old('iframe', $questions->iframe) }}</textarea>
        <small id="iframeHelp" class="form-text text-muted">Inserta la url del video.</small>
    </div>

    <div class="form-group d-flex flex-column">
        <label for="image">Imagen asociada</label>
        <input name="image" type="file" class="py-1">
    </div>
    <div class="form-group">
        <label for="category">A que categoria pertenece</label>
        <select name="category_id" class="form-control form-control-lg" id="category_id">
            @foreach($category as $category)
                <option value="{{ $category->id }}">{{ $category->name }}</option>
            @endforeach
        </select>
        <small id="selectHelp" class="form-text text-muted">Elige una categoria.</small>
    </div>
    <hr />
    @CSRF
    @method('PUT')
    <button type="submit" class="btn btn-primary">Guardar pregunta</button>
</form>

{{-/tests/{{$tests->id}}/问题--}
{{----}}
描述普雷孔塔酒店*
{{old('description',$questions->description)}
描述一下你的生活。
视频协会*
{{old('iframe',$questions->iframe)}
视频插页。
阿索西亚图像酒店
狭义的分类
@foreach($category作为$category)
{{$category->name}
@endforeach
Elige una categoria。

@CSRF @方法('PUT') 瓜达尔普雷孔塔酒店
那是你的路线但是

<form action="{{ route('questions.update', $questions->id ) }}" method="POST" enctype="multipart/form-data">
<form action="{{ route('questions.update', $questions->id ) }}" method="POST" enctype="multipart/form-data">
{{ route('questions.update', [ $exams->id, $question->id ]) }}