I'm trying to get from my edit page to my update page but there is nothing in the documentation that's explaining how to route to it. This is my form on my edit page:
/*
Or method="PUT"
*/
<form method="PATCH" action="../{{$id}}">
{{ method_field('PUT') }}
<input type="submit" value="edit"/>
</form>
My routes is being declared as a resource controller:
Routes::resource('/','TestController',['parameters' => [
'' => 'test'
]]);
In my controller I just have:
public function update(Request $request, Test $test){
return 'test';
}
It's just giving me different errors when trying to access the update action in multiple ways.
I tried: {{route($id)}}
which gives me:
Route 1 not defined
The resource documentation gives me that the url is suppose to be like this:
PUT/PATCH /photos/{photo}
I dont understand the routing of resource controllers in laravel and theres not a lot to find about it. I even tried to simply go 1 back from /{{$id}}/edit
like this: ../{{$id}}
but that just brings me to the show action(since show and update have the same url apparently) and I also think this isnt the best way to access an action from the controller.