Skip to content

Using chunk method for every row #174

Discussion options

You must be logged in to vote

Hi, a better approach could be to use the width method of buttons:

$specialitieKeyboards = [];
foreach (specialities as $specialitiy) {
    $specialitieKeyboards[] = ReplyButton::make($specialitiy->name)->webApp('google.com')->width(0.5);
}

Telegraph::message('<b>Message</b>')
    ->replyKeyboard(ReplyKeyboard::make()
        ->button('◀️button')->width(1)
        ->button('🔙button')->width(1)
        ->buttons($specialitieKeyboards)
        ->button('◀️button')->width(1)
        ->button('🔙button')->width(1)
    )->send();

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@abduqodirovshukrullo
Comment options

Answer selected by fabio-ivona
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #173 on September 15, 2022 13:25.