定制 philo/laravel5-facebook 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

philo/laravel5-facebook

最新稳定版本:v1.0.1

Composer 安装命令:

composer require philo/laravel5-facebook

包简介

Laravel 5 - Facebook SDK v4 wrapper.

README 文档

README

68747470733a2f2f706f7365722e707567782e6f72672f7068696c6f2f6c61726176656c352d66616365626f6f6b2f76657273696f6e2e737667 68747470733a2f2f706f7365722e707567782e6f72672f7068696c6f2f6c61726176656c352d66616365626f6f6b2f646f776e6c6f6164732e737667

Installation

The package can be installed via Composer by requiring the "philo/laravel5-facebook": "1.0.*" package in your project's composer.json.

{
    "require": {
        "laravel/framework": "~5.0*",
        "philo/laravel5-facebook": "1.0.*"
    },
    "minimum-stability": "dev"
}

Next you need to add the service provider to app/config/app.php

'providers' => array(
    // ...
    'Philo\Laravel5Facebook\Laravel5FacebookServiceProvider',
)

And do the same for the alias:

'aliases' => array(
	// ...
	'Facebook'  => 'Philo\Laravel5Facebook\Facades\Facebook',
)

Add Facebook to services

Laravel 5 has a new file that contains all third party services (app/config/services.php). Add your client_id and client_secret.

<?php

return [

	/*
	|--------------------------------------------------------------------------
	| Third Party Services
	|--------------------------------------------------------------------------
	|
	| This file is for storing the credentials for third party services such
	| as Stripe, Mailgun, Mandrill, and others. This file provides a sane
	| default location for this type of information, allowing packages
	| to have a conventional place to find your various credentials.
	|
	*/

	'facebook' => [
		'client_id' => '1234567891234612',
		'client_secret' => 'a837f07gjsoxya721964120z7dkgr',
	],
];

Usage

// Create session
$token = '<facebook access token>';
Facebook::createSession($token);

// Request
$user = Facebook::request('/me')->getGraphObject(GraphUser::className());

I've added a couple shortcuts for the most common graph objects.

$user = Facebook::user();
$location = Facebook::location();
$albums = Facebook::albums();
$album = Facebook::album(1234567890);

If you would like to access the FacebookSession object, call the getSession method.

$session = Facebook::getSession();
$info = $session->getSessionInfo();

统计信息

  • 总下载量: 787
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-11-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固