laravel/framework — pull request #396 by cmillr (2013-02-20 23:19:17+00:00)
Title: Namespaced Controller Routing Bug

If you use a RESTful controller call (`Route::controller()`) in your routes, things break if your controller call starts with a leading `\`. If you do this, all traffic to this route will fall through to the controller's `missingMethod`.

The failure happens in the `isRoutable()` method of the Inspector; the ReflectionClass automatically strips the leading backslash, while the passed controller name includes the leading backslash. This causes the two class names to be seen as not equal (though they are the same) which causes the inspector to see all methods (i.e., `getIndex()`) as inherited.

So what I did here:

1. I caused the unit test to fail by adding a leading backslash to the class name in the `getRoutable()` call.
2. I fixed it by taking both the method's class name *and* the controller's class name from the router.

This means both names will have leading backslashes auto-stripped, so the comparison operation doesn't need to account for the possibility of leading slashes.