Extension of PHP SDK 4 for Laravel's custom session handling in L5.
- Get the repository files.
- Go to your project folder and open up composer.json with your favorite editor
- Find the "autoload" part, where you can see PSR-4 if using Laravel 5. Add the new namespace:
"RapliAndras\\Facebook" : "vendor/rapliandras/facebook"
- Find the file
FacebookLoginRedirectHelper.php
and copy it tovendor/rapliandras/facebook/laravel
. This is the only file in this package by the way :) It is responsible for a server side login to Facebook. - Generate new classpaths with
composer dump-autoload -o
. The param-o
is for optimized. - Find the file
FacebookController.php
and copy it to yourapp/Http/Controllers
folder. Now open it, and replace the dummy values with yourAPP_ID
andAPP_SECRET
. - Set up a route for the method
FacebookController@login
to check the result. - Enjoy.
Note: The official Facebook PHP SDK 4 must be installed and autoloaded too of course!
MIT license. Andras Rapli, http://rapliandras.hu