PHP code example of micromagicman / laravel-telegram-webapp

1. Go to this page and download the library: Download micromagicman/laravel-telegram-webapp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

micromagicman / laravel-telegram-webapp example snippets


@extends('telegram-webapp::main')

@section('lang', 'CN')

@section('head')
// some scripts, css, meta
@endsection

@section('title', 'My title')

@section('content')
    <div id="app-content">
        // My spa content
    </div>
@endsection


use Micromagicman\TelegramWebApp\Api\TelegramBotApi;

private TelegramBotApi $botApi;

$response = $botApi->answerWebpAppQuery([
    'type' => 'document'
    // ...
    // one of InlineQueryResult variations
    // ...
]);
bash
php artisan vendor:publish --provider="Micromagicman\TelegramWebApp\TelegramWebAppServiceProvider"