I have a question, I am working on a project and I need to send a variable that contains an ID to my create method or that simply passes me the url, for that I am using resource type routes:
Route::resource('encuestaspy/participar', 'Users\RespuestaController');
This is my view
@foreach ($preguntas as $pregunta)
@if($pregunta->user_id == $empresa->id)
@if($pregunta->estado == 1 )
<div class="col-sm-3 col-xs-6">
<div style="padding: 10px;"></div>
//qui es donde quiero mandar mi variable con cierto ID.
<a href="{{url('encuestaspy/participar/create'.$pregunta->pregunta_id)}}">
@if(empty($pregunta->foto))
<img class="img-responsive portfolio-item" width="300" src="http://placehold.it/500x300" alt="">
@else
<img id="imagen" class="img-responsive portfolio-item" src="{{asset('imagenes/encuestas/'.$pregunta->foto)}}" width="300" alt="">
@endif
</a>
<p class="text-center">{{$pregunta->titulo}}</p>
@if ($dt->format('Y-m-d H:i:s') > $pregunta->fecha_finalizacion)
<p style="color:#FF0000"; class="text-center">Encuesta finalizada</p>
@endif
<p class="text-center"><b>Culmina el:</b>{{$pregunta->fecha_finalizacion}}</p>
</div>
@endif
@endif
@endforeach
This is the method of my controller, which for now only returns a view because I still do not write anything because I need the id to start
public function create()
{
//
return view('welcome');
}
EYE: I know that the variables I need can be sent by GET routes, but I need them to be with routes of RESOURCE types by order of my boss: (