staydecent/Gum — pull request #1 by bjornpost (2013-01-13 14:02:57+00:00)
Title: Added `request` method, so a route can respond to both GET and POST requests.

We're using Gum for a while now, and notice that we have lots of pages that require both `GET` and `POST` access. So before implementing this patch, we ended up with loads of repetitive code:

Route::get('/panel/saved', function() { .. });
Route::post('/panel/saved', function() { .. });

This patch implements a `Route::request()` method, which allows you to create routes which respond to both `GET` and `POST` requests. The functions signature is the same as for `Route::get()` or `Route::post()`.

I've chosen the `request` name as it basically works the same as the `$_REQUEST` superglobal. Maybe something like `getOrPost` works better, but I'll leave that up to you.

Hope you accept my pull request.