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="{{route('admin/questions/update',$question->id)}}"><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
And your "QuestionsController@edit" accepts "id" argument? like
function edit($id){}
And I think, your are using wrong route link helper
Route::get('user/{id}/profile', function ($id) {
//
})->name('profile');
$url = route('profile', ['id' => 1]);
You can't wrap a hyperlink around a button so my assumption is your problem is related to the form action (since button type is submit), not the a href
.
Since it appears you're using bootstrap, there is no need to use a button to get the styling of a button.
<a class="btn btn-primary">
will work just fine.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
I have two separate pages : issuance_filterphp and memo_list
I want to get the distance from the HC-Sr04 ultrasonic sensor and the color of the led light displayed on my laptop via PHP can anyone please help i am stuck hereThanks in advance