- How do I install cosenary/instagram in a Laravel application?
- Install it with Composer using composer require cosenary/instagram. The package is framework-agnostic and does not ship a Laravel service provider, facade, or config file, so you instantiate MetzWeb\Instagram\Instagram manually. You then pass your client ID, client secret, and redirect URI into the class before starting OAuth.
- Does cosenary/instagram support Laravel 10 or Laravel 11?
- There is no official Laravel version support because the package contains no service provider or framework integration. Composer may still install it in modern Laravel projects, but it uses PHP 5-era idioms and has no PHP 8.x hardening. Expect dynamic property deprecations and possible cURL behavior issues, and test carefully before relying on it.
- Can I use cosenary/instagram with Laravel Socialite for Instagram login?
- No, this package handles its own OAuth 2.0 flow and is not a Socialite driver. Laravel Socialite does not provide an official Instagram provider, so you cannot delegate this package's authentication to Socialite. For current Instagram Graph API access, the relevant login flow is Facebook Login for Business, not the retired Instagram REST API.
- How does cosenary/instagram authenticate users and handle access tokens?
- It manages the OAuth 2.0 authorization code flow by generating a login URL, receiving the callback code, and exchanging it for an access token. Token handling is simple and session-oriented, which does not meet modern expectations for secret management or long-lived token refresh. You should not treat its token storage as production-grade without adding your own controls.
- Which Instagram endpoints does cosenary/instagram support?
- It provides methods for user, media, likes, comments, tags, and location endpoints using GET, POST, and DELETE requests over cURL. Those methods target the retired api.instagram.com v1 REST API. They do not target the Instagram Graph API, so live Instagram integrations require a different host, authentication flow, and permission model.
- Is cosenary/instagram safe to use in production in 2025?
- It carries high technical risk because it is unmaintained, targets a retired API, and has no tests or security advisory process. The OAuth token handling is naive and the codebase is PHP 5-era, so PHP 8.x compatibility and compliance are concerns. If you inherit it, quarantine it behind an application-owned adapter rather than letting controllers, jobs, or models depend on it directly.
- How should I test a Laravel application that uses cosenary/instagram?
- Do not mock the package class throughout your codebase. Define an application-owned InstagramGateway interface, implement it with a legacy adapter that wraps MetzWeb\Instagram\Instagram, and mock the interface in your tests. Add contract tests against recorded fixtures so the adapter behavior is pinned before any migration.
- What are the alternatives to cosenary/instagram for Instagram API work in Laravel?
- For live Instagram capabilities, use the Instagram Graph API with Facebook Login for Business, typically through Laravel's HTTP client and a Facebook OAuth flow. The Basic Display API that superseded the old REST API was deprecated in December 2024, so it is not a durable target. Community Graph API packages may help, but you still own Meta app registration, business verification, scopes, and app review.
- Does cosenary/instagram include a Laravel service provider, facade, or config file?
- No. It is a single global-namespaced class, MetzWeb\Instagram\Instagram, with no service provider, facade, contract, config file, or tests. In Laravel you must wire it by hand in a service provider and bind it behind your own interface. That encapsulation step is the highest-leverage way to keep the dependency replaceable.
- Is cosenary/instagram still maintained, and can I fork it?
- The package is unmaintained and its upstream API target is dead, so stars and older usage do not indicate current support. Its BSD-3-Clause license does permit a fork, which is the realistic salvage path if you must keep an inherited integration alive. A fork can address PHP 8.x issues and containment, but it cannot make the retired Instagram endpoints work again.