laravel/laravel — Issue #334: [3.0 RC2] Routes later defined with different method override routes with same URI (but different method)
Author: djtarazona
Created: 2012-02-12 23:28:05+00:00
State: open

Let's say I have two routes, `GET account` and `PUT account`. On the `GET account` route, I am defining a name for the route (`'account'`). After I have defined that route, I then define another route for `PUT account` that doesn't have a name.

The second route definition, `PUT account`, overrides the `GET account` route even though they are different methods (but same URI). Therefore `URL::to_route('account')` throws an exception saying it can't find the named route.

See: http://paste.laravel.com/om

The output is: http://paste.laravel.com/on

If I remove the second route definition (PUT account), then the output becomes: http://paste.laravel.com/oo
... (notice no NULL; Laravel finds the route correctly).