Search code examples
backbone.jslaravellaravel-4laravel-routing

Laravel RESTful returning 301 state


Mates, I'm developing a Backbone/Laravel application. When I try to send a POST request to a certain resource, it returns me 301 status with no response, regardless that on the controller i'm printing a 'hello world', to check if it's getting to that point.

Here's some code...

public function store()
    {
        //
        return 'hello world';
    }

This is the routes.php

Route::group(array('before' => 'auth'), function()
{
    Route::get('/', 'SitesController@index');
    Route::resource('rooms', 'RoomsController');

});

So, when I make a POST request to

rooms

With some info to save, it gives me back 301 status with no response at all.

Any idea what am I doing wrong?

Thanks in advance!


Solution

  • Solved!

    On backbone collection configuration, I had url parameter with '/' at the end.

    rooms/
    

    Deleted that slash and now it works fine. Hope someone find's this helpful