I'm writing a webservice API (in laravel 4.2).
For some reason, the routing to one of my controllers is selectively failing based on HTTP method.
My routes.php looks like:
Route::group(array('prefix' => 'v2'),
function()
{
Route::resource('foo', 'FooController',
[ 'except' => ['edit', 'create'] ]
);
Route::resource('foo.bar', 'FooBarController',
[ 'except' => ['show', 'edit', 'create'] ]
);
}
);
So, when I try any of GET / POST / PUT / PATCH / DELETE methods for theproject.dev/v2/foo
or project.dev/v2/foo/1234
urls, everything works perfectly.
But, for some reason, only GET and POST work for project.dev/v2/foo/1234/bar
. The other methods just throw a 405 (MethodNotAllowedHttpException).
(fyi, I am issuing requests via the Advanced Rest Client Chrome extension.)
What's going on?
What am I missing?
currentproject.dev/v2/companies/legalname/1234/
? – silkfire