I have a view in Laravel with the following code:
<h1>Edicion</h1>
@foreach ($usuarios as $usu)
<h4>{{$usu->nombre}}</h4>
<a href="prurequests/{{$usu->slug}}/edit">editar</a>
@endforeach
A controller:
Route::resource('/prurequests','PruebasControllers\PrurequestsController');
With edit method:
public function edit($slug)
{
$usuario = Usuario2::where('slug','=',$slug)->firstOrFail();
return view('vistaspruebas.edit', compact('usuario'));
}
When I get to this view, my URL is: / public / prurequests / vaca / edit
in this view I have this code
<form action="prurequests/suma method="POST">
@method('PUT')
@csrf
<label for="nombre">ingrese nombre</label>
<input type="text" name="nombre" value="{{$usuario->slug}}">
<br />
<button type="submit" name="" value="submit">Actualiza</button>
</form>
and Laravel instead of looking for that route: "prurequests / suma" look for this / public / prurequests / cow / prurequests / suma
Does anyone know why after that tag and call another route I remove the 'edit' and change it by whatever route I put?