Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #500

    Hi, I really don’t understand why its throwing me this error in production but not in local development

    ” (Illuminate\Routing\Exceptions\UrlGenerationException(code: 0): Missing required parameter for [Route:] [URI: questions/{question}] [Missing parameter: question] ”

    Here is my route in web.php

    Route::get(‘/questions/{question}’, [QuestionController::class, ‘show’])->name(‘’);

    And the page the throws that error includes the following code:

    <a* href=”{{route(‘’, $question)}}”>


    Again this works in local but its throwing me the error in production. I also changed the parameter field from $question to ‘question’ => $question but still not working


    The code is right. Just check on the $question model you passed to the route and check if it is returning to null.

    It could be that some of the model have null id attribute value of null. Or if you are still in the development stage and the data are fakes, you can do remigrate you tables and repopulate you data

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.