Can anyone explain how I redirect to a named route that uses a parameter in the URL?
I have the following code:
Route::put('{handle}', array(
'as' => 'section.update',
'uses' => 'Manneken\\Api\\SectionManager@update'
));
Route::post('{handle}', function()
{
if (Input::has('method') && Input::get('method') === 'PUT') {
Redirect::route('section.update', array(
'handle' => ''
))->withInput();
}
});
So, I have a route using PUT that has {handle}
in the URL, and if requested by POST, I want to redirect to that route. How do I pass the {handle}
through?
Route::put
. Where did you find it by the way? Laravel Documentation doesn't seems to mention it. I can't figure out completely what'{handle}'
does as a parameter in theRoute::post
. Can you point me in the right direction with a link or a brief explanation? I would appreciate it very much! – giannis christofakis'{handle}'
you mean the request that the routes handle, it's that right? Yes I knowPUT
requestDELETE
,PATCH
restful stuff. Thnx, do you know any good source of information, other than the Laravel Documentation to suggest? – giannis christofakis'{handle}'
represent any request. 2. I think that Nettuts has some good tutorials on laravel. – Hakim{handle}
is the name of any value passed as a request and would be used in the controller as$handle
as far as I know. I put this to bed for a while and I'm only just getting back into Laravel. – designermonkey