0

I'm trying to access my url at: http://localhost/app/public/questions/1

My Routes

 $this->get('/questions/{question_id}','questionController@show');

My controller

public function show($question_id) {

    $showQuestion=questions::findOrFail($question_id);
    return redirect('questions',compact('showQuestion'));
}

For some reason I'm getting this error

InvalidArgumentException in Response.php line 458:
The HTTP status code "1" is not valid.

What could be the problem?

2 Answers 2

1

I guess you are trying to return a view

public function show($question_id) {

    $showQuestion=questions::findOrFail($question_id);
    return view('questions')->with('question', $showQuestion);
}

Source

Sign up to request clarification or add additional context in comments.

Comments

0

After having something similar myself, maybe you should be using:

return redirect('questions')->with('showQuestion', $showQuestion);

Comments

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.