Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

aholzer's avatar

Laravel 9 + Botman not working

Hello people,

I need to integrate botman in my Laravel app to comunicate some users vía telegram. I followed all steps in botman.io videotutorial but is not working for me. I have an older project that runs ok but it was made with botman studio using an older version of Laravel.

This is my environment:

PHP: 8.1.0
Botman version: 2.7

I -like the tutorial indicates- did:

composer create-project laravel/laravel mybot1
composer require botman/driver-telegram

Then add: routes/botman.php with

<?php

$botman = app('botman');

$botman->hears('botman', function($bot) {

    $bot->reply('Im botmaaaaan');

});

$botman->fallback(function($bot) {

    $bot->reply('Ich verstehe euch nicht');

});

Added routes/botman.php to RouteServiceProvider.

Created route in routes/web.php like:

Route::post('/botman', function() {
    
    app('botman')->listen();

});

Using ngrok: ./ngrok http 8000 and successfully setted a webhook for telegram bot (bot is not the problem, it works fine with the other project)

I wrote to the bot through telegram and ngrok indicates 200 OK but no answer arrives to my chat.

Any idea? What am I missing?

Also tried to install botman/tinker but composer said: * "[...] Conclusion: don't install laravel/framework v.9.41.0 (conflict analysis result) [...]" *

Thanks!

0 likes
0 replies

Please or to participate in this conversation.