What's your route look like that's calling getAdd()?
For post information to be passed through to a url via POST you need:
Route::post('<target url>', array(
'uses' => 'MyController@someDataHandler',
'as' => 'myKey'
));
Alternatively, if you'd like the incoming data to be arbitrary:
Route::any('<target url>', array(
'uses' => 'MyController@someDataHandler',
'as' => 'myKey'
));
I dont have a route for get add. Since it was in the products controller I assumed
Route::controller('admin/products', 'ProductsController');
would handle everything on that page. The tutorials dont go much into detail about routes.
So in your example what would 'myKey'?
I have tried:
Route::post('admin/products', array(
'uses' => 'ProductsController@getAdd',
'as' => 'Add'
));
and still getting the same result.
'as' => 'myKey'
is an easy way to define your routes with a constant name. So, in the event that your route path might change, you don't have to change the call to the route elsewhere, provided you used this constant value 'myKey'.
It is arbitrary, so you can use 'Add' or 'get.add' or even 'irrelevant.name', just try to make it relevant obviously.
Looking at the Route you tried, I can say that the route needs to be synonymous with the route your form is posting to.
Can you post your relevant route file data and the contents of the page you're posting to as well?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community