Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Symfony Bundle

Symfony Bundle Laravel Package

nutgram/symfony-bundle

A Symfony bundle that integrates Nutgram, the PHP Telegram bot framework, into Symfony applications. It provides bundle configuration, service container integration, and a Symfony-native setup for building, running, and maintaining Telegram bots.

View on GitHub
Deep Wiki
Context7

Nutgram for Symfony

Frequently asked questions about Symfony Bundle
Is nutgram/symfony-bundle a Laravel package?
No. It is a Symfony bundle that integrates the Nutgram Telegram bot framework into Symfony's dependency injection container, configuration system, and console. Laravel does not auto-discover or bootstrap Symfony bundles, so it is not a drop-in dependency for a Laravel application. For Laravel, evaluate nutgram/laravel or the nutgram/nutgram core package instead.
How do I install nutgram/symfony-bundle?
Install it with Composer alongside the Nutgram core it depends on, then register the bundle in your Symfony application's bundle list (config/bundles.php in a typical Flex project). You then create a bundle configuration file, usually config/packages/nutgram.yaml, holding your bot token and runtime options. The bundle requires a Symfony application with the DI container and console available; it is not a standalone library.
How do I configure the Telegram bot token with this bundle?
Bot settings live in YAML under the bundle's configuration root (typically nutgram:), so the token and runtime options stay out of your PHP services. The token is injected into the Nutgram client through the service container rather than being read from environment variables inside handlers. In practice you reference an environment variable from the YAML so production secrets stay out of version control. Confirm the exact key names against the bundle's README for your pinned version, since 1.2.0 announced no configuration schema changes.
Can I use nutgram/symfony-bundle in a Laravel application?
Not in any meaningful way. The package registers Symfony-specific extension and compiler-pass classes, and Laravel's container will neither auto-discover nor bootstrap them. The practical path is to require nutgram/nutgram directly behind a Laravel service provider with a published config file, or adopt nutgram/laravel if it matches your Laravel and PHP baseline. Porting a Symfony bundle into Laravel just to reuse a few classes is not worth the glue code.
Which Symfony versions does nutgram/symfony-bundle 1.2.0 support?
Version 1.2.0 widens the compatibility envelope to include Symfony 8 alongside the previously supported majors. That is a widened constraint rather than a hard bump, so projects on older Symfony versions are not forced to upgrade. The realistic risk is transitive Composer resolution drifting onto Symfony 8 and conflicting with other bundles' constraints. Check composer why-not or your lock file if you see unexpected Symfony major resolution.
How do I run a Nutgram bot with long polling in Symfony?
The bundle registers a console command that starts the bot using Nutgram's long-polling loop, so you run it through bin/console in the usual Symfony way. Long polling is convenient for local development and small deployments because it needs no public HTTPS endpoint. For anything serving real traffic, prefer webhook mode instead. Keep the running command aligned with your deployed release so a restart picks up the intended code version.
Does nutgram/symfony-bundle support webhooks for production?
Yes. Webhook support is part of the bundle's feature set, letting Symfony's HTTP layer receive Telegram updates instead of running a long-polling process. That fits production deployments behind a normal web server or load balancer with a valid TLS endpoint. You still need to register, and when rotating reset, the webhook with Telegram. Route security and update de-duplication remain your application's responsibility.
How are bot handlers and middleware registered through dependency injection?
Handlers, middleware, and other bot services are ordinary Symfony services, so you register them in services.yaml and let the container autowire their dependencies. The bundle resolves them when building the bot, which keeps handler classes testable in isolation. Because they are container-managed, you can swap collaborators in functional tests or mock them without touching bot code. Native Symfony events are also available if you prefer event-driven reactions over direct handler wiring.
Is the void return type change in 1.2.0 a breaking change for subclasses?
Nominally no: 1.2.0 is a minor release with no declared breaking changes, and the void additions are the standard PHP 8.4 implicit-nullable deprecation remediation. They are still source-level signature changes, so any consumer that subclasses or mocks those methods with a non-void return type, or uses a ReturnTypeWillChange shim, can hit a fatal signature-compatibility error. If you extend the bundle's classes, run your test suite against 1.2.0 before pinning. If you only consume the bundle, practical exposure is minimal.
Is nutgram/symfony-bundle actively maintained and safe to depend on?
The 1.2.0 release shows active upkeep: current PHP and Symfony support, two first-time contributors, and no security-relevant changes. Technical risk in the release itself is low; the moderate risk is mis-scoped adoption, such as pulling a Symfony bundle into a Laravel estate where it does not belong. Treat it as an ecosystem-health signal for Nutgram upstream when deciding whether to standardize on the core package for bot workloads. Pin to ^1.2 if you do run it on Symfony, and add a dependency-watch entry for future releases.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource