Expensive,
Can you help me with this laravel redirect? I created a method where it re-evaluates the data and redirects, on the other hand at the time of redirect I get the error Route [climate.consensus.visual.ID] not defined, only that I defined the routes.
//Redirecionapublicfunctionredirect(Request$request,Pesquisa$pesquisa){$jaFeito=Consenso::where('pesquisa_id',$pesquisa->id)->count()>0;if($jaFeito){returnredirect()->route('clima.consenso.visual.'.$pesquisa->id);}returnredirect()->route('clima.consenso.show');}
Route
//Grupoconsenso$router->group(['prefix'=>'consenso','as'=>'consenso.'],function($router){/**@var\Illuminate\Routing\Router$router*/$router->get('/',['uses'=>'ConsensoController@index','as'=>'index']);$router->get('/pesquisa/{clima_pesquisa}',['uses'=>'ConsensoController@show','as'=>'show']);$router->post('/pesquisa/{clima_pesquisa}',['uses'=>'ConsensoController@store','as'=>'store']);$router->get('/visual/{clima_pesquisa}',['uses'=>'ConsensoController@visual','as'=>'visual']);$router->get('/redirect/{clima_pesquisa}',['uses'=>'ConsensoController@redirect','as'=>'redirect']);});
View
@forelse($pesquisasas$pesquisa)<tr><thscope="row">
<a href="{{ route('clima.consenso.redirect', compact('pesquisa')) }}">{{$pesquisa->id}}</a>
</th>
<td>
<a href="{{ route('clima.consenso.redirect', compact('pesquisa')) }}">{{$pesquisa->matricula}}</a>
</td>
<td>
<a href="{{ route('clima.consenso.redirect', compact('pesquisa')) }}">{{mb_convert_case($pesquisa->nome,MB_CASE_TITLE , 'UTF-8' )}}</a>
</td>
<td>{{ $pesquisa->updated_at->format('d/m/Y H:i') }}</td>
<td>
<button
type="button" class="btn">
<a href="{{ route('clima.consenso.show', compact('pesquisa')) }}">Avaliar</a>
</button>
</td>
</tr>