- How do I install joelbutcher/laravel-facebook-graph in a Laravel app?
- Install it with composer require joelbutcher/laravel-facebook-graph. The package service provider and facade are registered through Laravel package auto-discovery, so no manual provider registration is normally needed. After installing, publish the config file and add your Facebook app credentials plus an access token. No migrations or data model changes are introduced by the package.
- Which Laravel and PHP versions does laravel-facebook-graph support?
- Version 1.5.0 adds Laravel 12.x support, and the package is intended for Laravel 10 through 12 applications. Because Laravel 12 requires PHP 8.2 or higher, teams on older PHP runtimes must confirm their platform meets that floor before adopting this release. If you are staying on Laravel 10 or 11, check the illuminate/* constraints of the specific package version you pin before running composer update.
- How do I configure the Facebook app ID, secret, and Graph API version?
- Publish the package config file, then set app_id, app_secret, default_graph_version, default_access_token, and persistent_data_handler to match your Facebook app. The default_graph_version key controls which Graph API version your calls are made against, so review it explicitly rather than relying on the package default. Once configured, you can resolve the client through the provided facade or dependency injection.
- Can I use this package for Facebook Login and OAuth in Laravel?
- No. This package is a thin wrapper around the Facebook Graph PHP SDK for server-side Graph API access; it is not an OAuth login solution. It does not implement the redirect, callback, or state handling you need for user login flows. Use Laravel Socialite or a dedicated OAuth implementation for Facebook Login, and use this package for token-driven Graph calls.
- How do I publish posts to a Facebook Page or pull Page insights?
- Authenticate with a Page access token that has the required permissions, then issue the corresponding Graph API write or read calls through the package client. Page publishing and basic insights retrieval are exactly the use cases this wrapper targets. For anything high volume or business critical, dispatch the calls to a queue rather than doing them inline in a web request.
- Does laravel-facebook-graph handle access token refresh and rotation?
- Token lifecycle is left to your application. The package passes through the tokens you configure or supply at call time, but it does not ship automated refresh or rotation helpers. In practice you should exchange short-lived tokens for long-lived Page tokens and store them securely, then assign an internal owner for rotation. Verify your refresh and exception-handling paths in staging before relying on them in production.
- Which Graph API version is used by default, and how often is it updated?
- The version comes from the default_graph_version config key, which is ultimately constrained by the pinned facebook/graph-sdk dependency. Facebook deprecates Graph API versions on a roughly two-year cycle, so the configured version determines your exposure to breaking changes. Track the package's version bumps and the SDK release notes, and plan to raise the version deliberately rather than assuming it stays current.
- How should I handle Facebook Graph API rate limits and errors?
- Throughput is bounded by Facebook's Graph API rate limits and per-Page token quotas, not by this package. Queue your publishing jobs and back off when you receive FacebookResponseException or rate-limit responses, and log failures with enough context to replay them. Because the wrapper is thin, most retry and backoff logic remains your responsibility in the host application.
- Is upgrading from v1.4.0 to v1.5.0 a breaking change?
- It is a minor version bump under semver, and the release primarily adds Laravel 12.x support via PR #33, so no intentional breaking changes to the package's own API are indicated. Existing v1.4.0 consumers can treat it as a routine composer update. Laravel 12 adopters should treat v1.5.0 as the minimum viable version, since earlier releases are effectively unsupported on Laravel 12.
- How does this package compare to using the Facebook Graph PHP SDK directly?
- The package is a thin Laravel wrapper: it adds a service provider, facade, and publishable config on top of the Facebook Graph PHP SDK, but it does not abstract the SDK away. Using the SDK directly gives you the same capabilities without the Laravel conveniences, and neither resolves the underlying upstream maintenance risk. The SDK has seen reduced upstream maintenance, so verify that the facebook/graph-sdk dependency resolves cleanly on your PHP version and designate someone to watch for Graph API deprecations.