Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

giwrgos's avatar

How I can use laravel as a Facebook canvas

Hello, I did a small app for facebook tab. I have added my app as a canvas on the facebook app manager. The first time I tried to open the app with the following url https://apps.facebook.com/****/

I've got the following error MethodNotAllowedHttpException in RouteCollection.php line 218:

I did a google search and I found out that the facebook is doing only post request so I've added an extra route with post like the following Route::post('/', [ 'as' => 'front.index', 'uses' => 'Front\HomeController@index']); Route::get('/', [ 'as' => 'front.index', 'uses' => 'Front\HomeController@index']);

On my second try, after i added the post, I've got the error TokenMismatchException in VerifyCsrfToken.php line 67: so i added the on the header of my template, and on my next try i've got the same error. Can anyone help me? thank you

0 likes
0 replies

Please or to participate in this conversation.