0

I have been trying to build a system that allows the admin to create a task, and once its created a URL should pop-up that directs the admin to the created task.

This worked so far until I crossed the (blockquote below) error

Missing required parameters for [Route: lesson.continue.task] [URI: lessons/{lessonId}/tasks/{taskId}].

This is the function that creates the URL:

 <div class="form-group row">
     <label class="col-2 col-form-label" for="level">URL</label>
     @if($task->id) {{ route('lesson.continue.task', $task) }} @endif
 </div>

And this is my route:

Route::get('/lessons/{lessonId}/tasks/{taskId}', 'LessonController@continueExistingLesson')->name('lesson.continue.task');

I've been stuck on this issue for a while now, hopefully someone is able to help me out, thanks in advance.

1 Answer 1

1

You should try this:

<div class="form-group row">
                <label class="col-2 col-form-label" for="level">URL </label>
                @if($task->id) {{ route('lesson.continue.task', [$lesson->id,$task->id]) }} @endif
            </div>
Sign up to request clarification or add additional context in comments.

3 Comments

This solved the missing parameters error, however it does not recognise the variable lesson.
@Rb.m: Actually you must need to parameters for this route (i.e taskId and lessionId).so please pass both variables in view file
@Rb.m: If my answer work for you then please accept my answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.