PanicPulse
Fortechub Services Limited // Enterprise Package

Official Beginner's Master Guide to PanicPulse

Learn how to hook real-time exception tracking, Gemini AI root-cause analyzers, and interactive Telegram response cards into your Laravel applications from scratch.

Step 1: Get Your Secret Credentials

Before installing the package, make sure you collect these three keys.

How to Get Your Telegram Bot Token

  1. Open your Telegram mobile or desktop app and search for @BotFather (look for the official blue verification checkmark).
  2. Click Start to open a chat conversation.
  3. Send the command: /newbot
  4. BotFather will ask you to name your bot. Type a friendly title (e.g., My App Watcher).
  5. Next, choose a unique system username ending in bot (e.g., my_app_panic_bot).
  6. Once generated, BotFather will give you an HTTP API Token (e.g., 712345678:AAG...). Copy and save this string.

How to Get Your Telegram Chat ID

  1. Search for your newly created bot username in Telegram and click Start.
    ⚠️ Important: If you do not click "Start" first, Telegram will block notifications with a 403 error!
  2. Create a Telegram Group, add your bot into the group, and send any test message.
  3. Open your web browser and paste this URL, replacing YOUR_BOT_TOKEN with your actual BotFather token:
    https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
  4. Look at the text result loaded in your browser window. Locate the numeric chat":{"id":-100xxxxxxxxxx} property. Copy that chat ID number.

How to Get Your Gemini API Key

  1. Navigate to Google AI Studio.
  2. Log in using your standard Google account credentials.
  3. Click on the Get API Key button located on the top left navigation menu.
  4. Click on Create API key in new project.
  5. Copy your newly generated key and store it securely.

Step 2: Package Installation

Integrate PanicPulse into your fresh Laravel project in seconds.

1

Require via Composer

composer require fortechub/panic-pulse:@dev
2

Run the Automated Installer Command

This publishes configuration values and sets up your exception pipeline hooks cleanly.

php artisan panic-pulse:install
3

Configure Your .env Environment

Paste your collected keys at the very bottom of your Laravel .env file:

PANIC_PAULS_TELEGRAM_BOT_TOKEN=your_bot_token_here
PANIC_PULSE_CHAT_ID=your_chat_id_here
GEMINI_API_KEY=your_gemini_api_key_here

Step 3: Test Your Integration

Trigger an exception to confirm your telegram connection is fully operational.

Add a Test Route in routes/web.php

use Illuminate\Support\Facades\DB;

Route::get('/test-panic', function () {
    // Triggers a strict QueryException handled automatically by PanicPulse
    DB::table('non_existent_table_xyz')->get();
});

Clear Cache and Visit Route

php artisan config:clear
php artisan cache:clear

Now open http://127.0.0.1:8000/test-panic in your browser. Check your Telegram—your report will arrive instantly!

⚠️ Things NOT to Do (Best Practices)

Avoid these common mistakes to keep your application secure and bug-free.

Never skip clicking "Start"

Do not skip sending a direct start message to your Telegram bot before hooking it up. If you skip this, Telegram throws a 403 Forbidden error.

Never expose `.env` credentials

Do not push your Telegram Bot Token, Chat ID, or Gemini API keys to public code hosting platforms like GitHub.

Do not forget cache clearing

Never forget to run php artisan config:clear after modifying credentials in your environment file.

Avoid manual core tampering

Avoid manually guessing core file lines when installing; let the automated php artisan panic-pulse:install handler do the configuration safely.