Which alternative for facebook graph-sdk api to use in laravel php project?

Viewed 284

I successfully used the facebook sdk api for php at least 8 years ago... so I wanted to check the newer version to use now.

From the Facebook developer page, it is recommended to use php-graph-sdk 5.7.0.

However when installing it into a Laravel project with composer, I got that msg:

- Installing facebook/graph-sdk (5.1.4): Extracting archive
Package facebook/graph-sdk is abandoned, you should avoid using it. No replacement was suggested.
Generating optimized autoload files
Class App\Http\Controllers\teamController located in ./app/Http/Controllers/TeamController.php does not comply with psr-4 autoloading standard. Skipping

I read about alternatives and found janu-software/facebook-php-sdk but thaqt installation with comp[oser also gives an error:

composer require janu-software/facebook-php-sdk
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.1.7 for janu-software/facebook-php-sdk
./composer.json has been updated
Running composer update janu-software/facebook-php-sdk
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires janu-software/facebook-php-sdk ^0.1.7 -> satisfiable by janu-software/facebook-php-sdk[v0.1.7, 0.1.x-dev].
    - janu-software/facebook-php-sdk[v0.1.7, ..., 0.1.x-dev] require php-http/client-implementation ^1.0 -> could not be found in any version, but the following packages provide it:
      - symfony/http-client Provides powerful methods to fetch HTTP resources synchronously or asynchronously
      - php-http/guzzle6-adapter Guzzle 6 HTTP Adapter
      - symfony/symfony The Symfony PHP framework
      - php-http/curl-client PSR-18 and HTTPlug Async client with cURL
      - php-http/guzzle7-adapter Guzzle 7 HTTP Adapter
      - kriswallsmith/buzz Lightweight HTTP client
      - php-http/mock-client Mock HTTP client
      - php-http/socket-client Socket client for PHP-HTTP
      - php-http/guzzle5-adapter Guzzle 5 HTTP Adapter
      - php-http/react-adapter React HTTP Adapter
      - voku/httpful A Readable, Chainable, REST friendly, PHP HTTP Client
      - code-tool/curl-client cURL client
      - php-http/buzz-adapter Buzz HTTP Adapter
      - christophwurst/nextcloud-http-client HTTPlug and PSR7 adapter for Nextcloud
      - juststeveking/http-slim A slim psr compliant http client to provide better interoperability.
      - swisnl/php-http-fixture-client Fixture client for PHP-HTTP
      - windwalker/http Windwalker Http package
      - php-http/cakephp-adapter Cake adapter for PHP-HTTP
      - windwalker/framework The next generation PHP framework.
      - mushroomcloud/guzzle6-adapter Guzzle 6 HTTP Adapter
      ... and 35 more.
      Consider requiring one of these to satisfy the php-http/client-implementation requirement.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require janu-software/facebook-php-sdk:*" to figure out if any version is installable, or "composer require janu-software/facebook-php-sdk:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

I need to implement a posting to facebook in php under laravel. Any suggestions?

0 Answers
Related