2

My Laravel App doesn't work on Facebook, seems like it gets confused on the routes.

This is my routes.php:

Route::get('ingresar', array('as' => 'ingresar', 'uses' => 'ingresar@index'));

This is my controller ingresar.php:

class Ingresar_Controller extends Base_Controller{

    public $restful = true;

    public function get_index() {
        echo "Controller Ingresar";
    }
}

When I open my app on Facebook I get 404 error.

Any clue?

Thanks in advance!

1 Answers1

6

Facebook apps send POST requests when loading your app in its iFrame. There's also a payload it sends (via $_POST data) with relevant information (app id, user id and some other data).

You may also want to set that controller/method to POST.

Route::post('ingresar', array('as' => 'ingresar', 'uses' => 'ingresar@index'));
fideloper
  • 12,213
  • 1
  • 41
  • 38