title: navigate on images of a product in a telegram bot
body: <p>I'm working on a telegram bot shop via <a href="https://github.com/php-telegram-bot/core" rel="nofollow noreferrer">https://github.com/php-telegram-bot/core</a> in laravel. </p>
  
  <p>In this app , each Product has many images that path of them is stored on th DB. </p>
  
  <p>Now I want when send details of a product , images of that shown one by one that user can navigate them via a prev and next <strong>inline keyboard</strong>. like this picture : </p>
  
  <p><a href="https://i.stack.imgur.com/9ZrjJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9ZrjJ.png" alt="enter image description here"></a></p>
  
  <p>For that after show all products in the shop as a <strong>inline query</strong> and after use choose one of them , On <strong>Chosen inline result Command</strong>,  I get a product Id and fetch first image of that from DB like this : </p>
  
  <pre><code>class ChoseninlineresultCommand extends SystemCommand
      {
      public function execute ()
      {
          $chosenInlineResult   = $this-&gt;getChosenInlineResult();
          $chosenInlineResultId = $product_id = $chosenInlineResult-&gt;getResultId();
          $chat_id              = $chosenInlineResult-&gt;getFrom()-&gt;getId();
  
          $product = Product::findOrFail($product_id);
  
          $picture = $product-&gt;images-&gt;first();
  
          $keyboard = KeyboardController::showProductKeyboard($product_id, $chat_id);
  
          $result = view('show-product', compact('product','picture'))-&gt;render();
  
          Request::sendMessage([
              'chat_id'      =&gt; $chat_id,
              'text'         =&gt; $result,
              'reply_markup' =&gt; $keyboard,
              'parse_mode'   =&gt; 'HTML'
          ]);
      }
      }
  </code></pre>
  
  <p>Also <code>showProductKeyboard</code> of <code>KeyboardController</code> is like this : </p>
  
  <pre><code>    static public function showProductKeyboard ($product_id, $user_id)
      {
  
          $inlineKeyboard = new InlineKeyboard([]);
          $inlineKeyboard-&gt;addRow(new InlineKeyboardButton([
              'text'          =&gt; ' previous picture ⬅️️',
              'callback_data' =&gt; 'prev_pic'
          ]), new InlineKeyboardButton([
              'text'          =&gt; '➡️ next picture ',
              'callback_data' =&gt; 'next_pic'
          ]));
  
          return $inlineKeyboard;
      }
  </code></pre>
  
  <p>And finally <code>show-product</code> blade is simple as : </p>
  
  <pre><code>️ &lt;b&gt;{{$product-&gt;title}}&lt;/b&gt;
  
  ✅ &lt;b&gt;{{str_limit(strip_tags($product-&gt;desc), 50)}}&lt;/b&gt;
  
   &lt;b&gt;{{number_format($product-&gt;price)}}&lt;/b&gt; dollor
  
  &lt;a href="{{config('app.url').'/upload/'. $picture}}"&gt; Picture&lt;/a&gt;
  </code></pre>
  
  <p>Problem is that I do not know how can I implement what I want .</p>