I have a laravel telegram-bot project and it handles telegram updates like this in api.php;
Route::post('/', function (Request $request) {
\WeStacks\TeleBot\Laravel\TeleBot::handleUpdate(
Update::create(json_decode($request->getContent()))
);
});
but since I upgraded telebot to 2.1 no matter what I do it does not run the update handlers and gives the error.
local.ERROR: WeStacks\TeleBot\Helpers\Type::castMany(): Argument #1 ($values) must be of type iterable, stdClass given.
any ideas what the problem might be?
Pass parameters as array:
Route::post('/', function (Request $request) {
\WeStacks\TeleBot\Laravel\TeleBot::handleUpdate(
Update::create(json_decode($request->getContent(), true))
);
});