Support the ongoing development of Laravel.io →
posted 10 years ago
Forms
Last updated 2 years ago.
0

Not quite sure what you mean...

$var->id is set as {examples}, and for 'id' => 'exampleupdateform' try using Form::hidden();

Or is the actual url http://localhost/examples/{examples} after submitting?

In that case is your route set as

Route::post('examples/{examples}, ['as' => 'examples.update', 'uses' => 'ExampleController@someMethod']);
Last updated 2 years ago.
0

I have this in my routes file:

Route::resource('examples', 'ExampleController');

Th code I posted literally submits the data to http://localhost/examples/{examples}. It should redirect to $var->id, which I have set for testing purposes as 1.

Also, I need the form to have an id.

Last updated 2 years ago.
0

Yeah the 'id' part is a big fail on my part... Seems like I need a break.

But from what I see it should work.. what does the rendered form action look like? Maybe try setting method => put

Last updated 2 years ago.
0

Wow, I needed a break too...

When I came back to the computer and saw your last post, I saw exactly what was wrong. I had been using the same for for both the create and edit methods, using an if statement to change the Form::open line. Well, turns out I had the above code for the create method, not the edit method.

Thank you for the help though. :)

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.