表单操作未重定向到路由

I have this controller:

  public function category($name)
  {
        $ch = DB::select('select * from quiz where category=?',['$name']);
        return View('quiz.index',['quiz'=>$ch]);     

 }

returning to the view quiz.index. this view has a form

<form method="POST" action="{{url('quiz/check/$quiz->category')}}"
{!! csrf_field() !!} 

@foreach ($quiz as $q)

@if($q->level=='1')
{{ $q->qid }}.  
{{ $q->question }}<br>
<input type='radio' name='mycheck[{{$q->qid}}]' value='1'>     
{{ $q->opt1 }}<br>
<input type='radio' name='mycheck[{{$q->qid}}]' value='2'>     
{{ $q->opt2 }}<br>
<input type='radio' name='mycheck[{{$q->qid}}]' value='3'>    
{{ $q->opt3 }}<br>
<input type='radio' name='mycheck[{{$q->qid}}]' value='4'>   
{{ $q->opt4 }}<br><br>
@endif
@endforeach        
    <button type="submit" class="btn btn-default">Get result</button>
                            </form>

what is wrong with the action in the form. it is not redirected to this route: in other words $quiz->category in action might not be working.

Route::post('/quiz/check/{name}', 'playquiz@check');

Try with this:

{{url("quiz/check/{$quiz[0]->category}")}

or in your controller change to:

return View('quiz.index')->with('show');

and the View:

{{url("quiz/check/$show->category")}

You have a variable and a method call inside single quotes. Either append it or use double quotes with curly brackets. In other words, don't do this:

url('quiz/check/$quiz->category')

but do either of these:

url('quiz/check/'.$quiz->category)
url("quiz/check/{$quiz->category}")