🔗 Telegram Connect — Test Page

This page demonstrates the <x-telegram-connect /> component embedded inside a registration-style form.

The component generates a one-time token (e.g. AB12CD), shows the user how to send it to the bot, and — once the bot receives /connect AB12CD — njects a hidden input with the resulting chat_id — your controller handles the rest.

â„šī¸ Set TELEGRAM_BOT_USERNAME in your .env so the "Open in Telegram" link works correctly. Current value: (not set)

📝 Sample Registration Form

The connect component is required here — it injects <input type="hidden" name="telegram_chat_id"> into the form. The form cannot be submitted until connected. Your controller then reads $request->input('telegram_chat_id').


Link your Telegram so our support team can reach you directly.

🎨 Prop Showcase

The component accepts label and color props for easy customisation:

📋 Usage

Drop the component into any Blade view:

<x-telegram-connect
    label="Connect Telegram"
    color="#1e88e5"
    :required="true"  
/>

Config keys (in config/telegram.php):

In your form controller:

$chatId = $request->input('telegram_chat_id');
// save to users table, session, or anywhere you like
$user->update(['telegram_chat_id' => $chatId]);