- What is maalls/botman-bundle and what does it do?
- maalls/botman-bundle is a Symfony bundle that integrates the BotMan PHP chatbot framework into Symfony applications. It lets you configure BotMan bots and platform drivers through Symfony configuration, register bot classes in the service container, and handle incoming webhook messages. It is a bridge, not a hosted chatbot service, so your bot logic and platform credentials remain in your app.
- How do I install maalls/botman-bundle with Composer?
- Install it with Composer using composer require maalls/botman-bundle. If you are not using Symfony Flex, register the bundle in config/bundles.php or your legacy kernel. Then add the bundle configuration for your BotMan platforms and bot services, and check the package's composer.json for PHP and Symfony version constraints before installing.
- Does maalls/botman-bundle work with Laravel?
- No, this package is built as a Symfony bundle and depends on Symfony's kernel, configuration system, and service container. Laravel applications should use a Laravel-specific BotMan integration or wire BotMan manually into Laravel services. Dropping a Symfony bundle into Laravel is not a supported setup.
- How do I configure BotMan platforms and bots in Symfony?
- Define your platform drivers and bot services in the bundle's Symfony configuration, then reference your bot classes as container services. The bundle uses Symfony's config and service container to instantiate BotMan and route incoming messages to the right bot. Store platform tokens and secrets in environment variables rather than committing them to config files.
- How do I handle BotMan webhook requests in a Symfony controller?
- Create a Symfony route and controller that loads the configured BotMan bot and calls BotMan's listen or run method for the incoming request. The bundle provides the bridge so the bot is built from your Symfony configuration and services. Make sure the route accepts the HTTP method your platform uses and matches any webhook verification requirements.
- Can I register custom bot classes and dependencies as services?
- Yes, you can define your bot class as a Symfony service and inject dependencies through constructor arguments. The bundle's service-container integration helps BotMan resolve your bot logic without manual wiring in each controller. Configure or tag the service as required by the bundle's documentation and your Symfony version.
- Does maalls/botman-bundle support BotMan middleware and conversations?
- Because it wraps BotMan, middleware and conversation classes work the same way they do in BotMan itself. You can register middleware for logging, NLP, or message transformation, and add conversations through your bot setup or as Symfony services. Conversations still rely on BotMan's caching or storage drivers, so configure a suitable driver for production.
- What Symfony and PHP versions does maalls/botman-bundle support?
- Support depends on the version constraints in the bundle's composer.json, so check those before installing rather than assuming from the README alone. Older Symfony bundles may not support Symfony 6 or 7 without changes. If the constraints are outdated, test in a branch or look for a maintained fork.
- How should I test a BotMan bot in a Symfony application?
- Unit-test your bot classes by mocking BotMan's message and hearing interfaces, and use Symfony's KernelTestCase to verify that services and configuration wire together correctly. For webhook routes, write functional tests that post a sample platform payload and assert the response. Avoid calling real platform APIs in automated tests.
- Is maalls/botman-bundle maintained, and what are the alternatives?
- Check the GitHub repository for recent commits, releases, and open issues before adopting it. Alternatives include wiring BotMan directly into Symfony services or using a more actively maintained BotMan Symfony integration if one is available. For Laravel projects, use a Laravel-specific BotMan package instead of this Symfony bundle.