Download the PHP package technobase/alert without Composer

On this page you can find all versions of the php package technobase/alert. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package alert

Alert - Laravel Telegram Error Notifications

Latest Version on Packagist Total Downloads License

A Laravel package for sending comprehensive error notifications to Telegram channels with detailed context, stack traces, and environment information.

Features

Requirements

Installation

Install the package via Composer:

The service provider will be automatically registered via Laravel's package discovery.

Configuration

1. Publish Configuration File

This creates config/alert.php in your application.

2. Set Environment Variables

Add these to your .env file:

3. Configure Telegram Bot

  1. Create a bot by messaging @BotFather on Telegram
  2. Send /newbot and follow the prompts
  3. Copy the bot token to your .env file
  4. Create a Telegram channel for errors
  5. Add your bot as an administrator to the channel
  6. Get the channel ID (use @userinfobot or check Telegram API)
  7. Add the chat ID to your .env file

Usage

Automatic Error Notifications

Once configured, Alert automatically catches all exceptions in production and staging environments and sends them to your Telegram channel.

No additional code needed! Just let your application run.

Testing the Integration

Send a test notification to verify your setup:

Or create a test route:

Manual Error Notifications

You can manually send error notifications:

Disabling for Specific Environments

Edit config/alert.php:

Or disable entirely:

Configuration Options

Option Environment Variable Default Description
enabled ALERT_ENABLED true Enable/disable package
bot_token TELEGRAM_BOT_TOKEN null Telegram bot API token
chat_id TELEGRAM_CHAT_ID null Telegram chat/channel ID
enabled_environments - ['production', 'staging'] Environments to send notifications
notification_title ALERT_NOTIFICATION_TITLE ๐Ÿšจ Application Error Title of error notifications
trace_lines ALERT_TRACE_LINES 10 Max stack trace lines
queue ALERT_QUEUE true Queue notifications
queue_connection ALERT_QUEUE_CONNECTION null Queue connection to use
log_notification_errors ALERT_LOG_ERRORS false Log notification failures
include_request_data ALERT_INCLUDE_REQUEST true Include URL & user ID
include_environment ALERT_INCLUDE_ENV true Include environment name

Example Telegram Notification

0 UserController.php(23): UserService->process()

1 Router.php(822): UserController->store()

2 Pipeline.php(180): Router->dispatch()

...

Troubleshooting

Bot Not Receiving Messages

  1. Check bot is admin: Your bot must be added as an administrator to the channel
  2. Verify chat ID: Use negative ID for channels (e.g., -1001234567890)
  3. Test with curl:

No Notifications in Production

  1. Check environment: Verify APP_ENV=production or staging
  2. Check config: Run php artisan config:cache after changes
  3. Check logs: Enable ALERT_LOG_ERRORS=true and check storage/logs/laravel.log
  4. Check queue: If using queues, ensure queue worker is running: php artisan queue:work

DNS Resolution Errors

If you see Could not resolve host: api.telegram.org:

  1. Check internet connectivity
  2. Flush DNS cache: sudo dscacheutil -flushcache (macOS)
  3. Try different DNS servers (e.g., Google DNS 8.8.8.8)
  4. Check firewall/antivirus settings

Notifications Delayed

If notifications arrive late:

  1. Check queue worker: php artisan queue:work must be running
  2. Disable queue: Set ALERT_QUEUE=false for immediate sending
  3. Check queue connection: Verify your QUEUE_CONNECTION is working

Security

Sensitive Data

Be careful not to send sensitive information in error notifications:

Best Practices

Testing

Run the package tests:

Or with PHPUnit directly:

Changelog

Please see CHANGELOG for recent changes.

Contributing

Contributions are welcome! Please submit pull requests to the main repository.

License

The MIT License (MIT). Please see License File for more information.

Credits

Support

For support, please contact [email protected] or open an issue on GitHub.


Made with โค๏ธ by Technobase


All versions of alert with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/notifications Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
laravel-notification-channels/telegram Version ^5.0|^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package technobase/alert contains the following files

Loading the files please wait ...