Tuesday, May 23, 2017

Laravel 5 Can't send data from url

Hi Im currently trying to make a basic crud for my questions resource on laravel 5

so far so good, but now Im having troubles displaying the edit view, because the url is not being created correctly when I try to send the resource id in the url

here's the anchor Im using

<a href=""><button class="submit-form button button btn btn-primary" style="margin: 0 1em;" type="submit">Editar</button></a>

here's the route in my routes file

Route::get('admin/preguntas/editar/{id}','QuestionsController@edit')->name('admin/questions/update');

the method in the controller works just fine, when I manually type this url

/admin/preguntas/editar/4

It shows the view without problems, but when I go from the anchor the url it goes is this one

/admin/preguntas/editar?4

of course the 4 is the id from my resource, but why is not typing the correct url?

thanks in advance



via Anibal Cardozo

Advertisement