2017 © Pedro Peláez
 

library social-connect

image

sourcescript/social-connect

  • Friday, August 29, 2014
  • by imcorleone
  • Repository
  • 6 Watchers
  • 9 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

SocialConnect

Created for Laravel By Sourcescript Innovations

Installation

add the the following to your composer.json "sourcescript/social-connect": "dev-master". Do a composer update --prefer-dist., (*1)

Add the following to config/app.php:, (*2)

Facade

<?php
    'Facebook'        => 'Sourcescript\SocialConnect\Facades\Facebook'

Providers

<?php
    ...
    'Sourcescript\SocialConnect\SocialConnectServiceProvider'
    ...

After the installation you have to do the following to be able to use the configuration fiels., (*3)

    php artisan config:publish sourcescript/social-connect

You'll have a blank configuration file as follows, (*4)

<?php
    return [
        'facebook'  => [

            /**
             *  Your Application ID
             *  ==========================/
             *  Found in your application itself
             */
            'app_id'        => 'app_id',

            /**
             *  Your Application Secret
             *  ==========================/
             *  Given By Facebook for auth purposes
             */
            'app_secret'    => 'app_secret',

            /**
             *  SCOPES
             *  ==========================/
             *  Granted by facebook. Required scopes 
             *  for facebook access
             */
            'scopes' => [

            ],

            /**
             *  Login Options
             *  ==========================/
             *  Login Callback Action after logging in
             */

            'login'  => [
                'redirect_uri'  => ''
            ]
        ]
    ];

How To Login Using SocialConnect

    <?php 
        ...
            //you should first fix the config file's login->redirect_uri to point to your callback function (That's where the script will go when the login function is all finished)
            $facebook = Facebook::make();
            $redirect_uri = '/facebook/login'; //the current route you want to point the login script
            return $facebook->login($redirect_uri); 
        ...

How to get the user profile in SocialConnect


<?php //returns array Facebook::make()->getProfile(); //the parameter would be either 'me' (current user logged in) or any valid facebook username or ID

How to get the user's profile image in SocialConnect

    <?php
        Facebook::make()->getProfileImage();

Twitter Soon!, (*5)

The Versions

29/08 2014

dev-master

9999999-dev

  Sources   Download

The Requires

 

by Sourcescript Innovations