beloop/instagram
Read-only Instagram component from the Beloop LMS suite. Provides Instagram-related integration as part of beloop/components, built on Symfony and released under the MIT license. For support, issues, and PRs, use the main beloop/components repository.
/users/self/media instead of modern Graph API). Breaking changes are probable without manual updates.Socialite or a custom OAuth2 service would be needed.InstagramPost) and migrations, adding boilerplate code.config/instagram.php is needed, increasing error risk (e.g., hardcoded credentials)./me/media). Risk of silent failures if relying on undocumented assumptions.symfony/http-client or other Symfony packages (e.g., symfony/console).create_command) may need updates for Laravel 10+./users/self/feed)?spatie/instagram-webhooks) a better fit for the use case?AppServiceProvider or a dedicated InstagramServiceProvider, using adapters to translate Symfony components (e.g., HTTP client → Laravel’s HttpClient).Instagram::fetchPosts()) to simplify usage and hide Symfony dependencies.Event::dispatch()).HttpClient with Laravel’s HttpClient or Guzzle via a decorator pattern:
use Illuminate\Support\Facades\Http;
use Beloop\Instagram\Client\InstagramClient as SymfonyClient;
class LaravelInstagramClient extends SymfonyClient {
protected function createHttpClient() {
return Http::macro('instagram', fn ($callback) => $callback(Http::baseUrl('https://api.instagram.com')));
}
}
InstagramPost, InstagramUser) and migrations. Example:
// app/Models/InstagramPost.php
class InstagramPost extends Model {
protected $fillable = ['id', 'caption', 'media_url', 'user_id', 'created_at'];
}
InstagramPostSeeder).config/instagram.php:
return [
'client_id' => env('INSTAGRAM_CLIENT_ID'),
'client_secret' => env('INSTAGRAM_CLIENT_SECRET'),
'redirect_uri' => env('INSTAGRAM_REDIRECT_URI'),
'scopes' => ['instagram_basic', 'instagram_content_publish'],
'cache_ttl' => 3600, // Cache API responses for 1 hour
];
HttpClient, EventDispatcher)./users/self/media).App\Services\InstagramApi to:
HttpClient instead of Symfony’s.Cache::remember).Socialite or a custom service.// app/Providers/InstagramServiceProvider.php
public function register() {
$this->app->singleton(InstagramApi::class, function ($app) {
return new InstagramApi(config('instagram'));
});
}
fetchPosts(), fetchUserMedia()).createPost()).Http::fake().create_command) may need updates.composer.json replacements:
"replace": {
"symfony/http-client": "symfony/http-client:^6
How can I help you explore Laravel packages today?