php - Passing variable with route parameter when form is submitted Laravel 5.2 -


i have in form in viewpage.php:

<form action="{{ route('test.route'), ['id' => $params_id] }}" method="post" > 

and in route.php:

route::post('/testing/{{id}}',[     'uses' => 'testcontroller@testmethod',      'as' => 'test.route' ]); 

and testcontroller:

public function avaliarsubordinor(request $request, $uid){     return $uid; } 

i error says 'missing required parameters for[route: test.route] [uri: testing/{{id}}]. want pass variable controller using route parameter when form submitted..

i dont know if doing properlly..if can me or point me example can understand doing wrong..

laravel 5.2 missing required parameters [route: user.profile] [uri: user/{nickname}/profile]

using above link found solution.. changed:

<form action="{{ route('test.route'), ['id' => $params_id] }}" method="post" > 

to

<form action="{{ route('test.route', $params_id]) }}" method="get" > 

and this:

route::post('/testing/{{id}}',[      'uses' => 'testcontroller@testmethod',       'as' => 'test.route' ]); 

to

route::get('/testing/{id}',[      'uses' => 'testcontroller@testmethod',       'as' => 'test.route' ]); 

and works! wonder if else can post version working, or way? dont know get/post request, it's used in forms , ajax.. learn more http get/post, if has add please share!! thanks! hope answer someone!


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -