jooservices / laravel-notifications
Laravel notification transport for Telegram, Slack, and email — send-only channel adapters with pre-rendered messages (no templates, queue, or logging).
Package info
github.com/jooservices/laravel-notifications
pkg:composer/jooservices/laravel-notifications
Requires
- php: ^8.5
- illuminate/contracts: ^12.0|^13.0
- illuminate/mail: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- jooservices/client: ^4.0
- jooservices/dto: ^3.2
- jooservices/exceptions: ^4.0
Requires (Dev)
- captainhook/captainhook: ^5.23
- captainhook/plugin-composer: ^5.3
- fakerphp/faker: ^1.24
- friendsofphp/php-cs-fixer: ^3.65
- laravel/pint: ^1.27
- orchestra/testbench: ^10.0|^11.0
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^12.0 || ^13.0
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-19 02:07:03 UTC
README
JOOservices Laravel Notifications is a send-only Laravel notification transport for Telegram, Slack, and email. The application owns templates, queueing, debounce, and logging. This package transports pre-rendered subject/body strings through channel adapters and returns a structured SendReport.
Composer package: jooservices/laravel-notifications — current line: v1.0.1.
Features
- Telegram Bot API (
sendMessage) viajooservices/client - Slack incoming webhooks via
jooservices/client - Mail via Laravel
Mailer(raw/ HTML send) — no package Mailables or Blade views - Immutable
MessageDTO (jooservices/dto) with optional HTML body, scalar context, and recipients - Per-channel
SendResultand aggregateSendReport - Missing credentials → skip (fail-open); HTTP/API errors → failed; other channels continue
- Context-aware exceptions (
jooservices/exceptions) - Auto-discovered service provider and
Notificationfacade
Non-goals
- Queue /
ShouldQueuehelpers - Templates / Blade / package Mailables / markdown mail
- Log / Discord / SMS channels
- Debounce / rate-limit
Requirements
- PHP
^8.5 - Laravel / Illuminate
^12|^13 - Extensions:
curl(for Telegram/Slack HTTP)
Installation
composer require jooservices/laravel-notifications:^1.0
Publish config
php artisan vendor:publish --provider="JOOservices\LaravelNotifications\LaravelNotificationsServiceProvider" --tag="config"
Environment
| Variable | Purpose |
|---|---|
NOTIFICATION_DEFAULT_CHANNELS |
Comma-separated defaults (e.g. telegram,slack,mail) |
NOTIFICATION_TELEGRAM_BOT_TOKEN |
Telegram bot token (also accepts TELEGRAM_BOT_TOKEN) |
NOTIFICATION_TELEGRAM_CHAT_ID |
Telegram chat id (also accepts TELEGRAM_CHAT_ID) |
NOTIFICATION_TELEGRAM_API_BASE |
API base (default https://api.telegram.org) |
NOTIFICATION_TELEGRAM_TIMEOUT |
Seconds (default 5) |
NOTIFICATION_SLACK_WEBHOOK_URL |
Slack incoming webhook URL |
NOTIFICATION_SLACK_TIMEOUT |
Seconds (default 5) |
NOTIFICATION_MAIL_MAILER |
Optional named mailer |
NOTIFICATION_MAIL_TO |
Comma-separated default recipients |
NOTIFICATION_MAIL_FROM_ADDRESS / NOTIFICATION_MAIL_FROM_NAME |
Optional from override |
Quick start
use JOOservices\LaravelNotifications\Facades\Notification; use JOOservices\LaravelNotifications\Message; $body = view('ops.crawl_alert', $data)->render(); // app owns templates $report = Notification::send( Message::make(subject: 'Source unhealthy: javdb', body: $body) ->html($htmlBody) // optional; mail only ->withContext(['source_slug' => 'javdb']), channels: ['telegram', 'slack', 'mail'], ); if ($report->hasFailures()) { // app may log from SendReport — package does not }
Omit channels to use NOTIFICATION_DEFAULT_CHANNELS / config default_channels.
Local development
make build
make install
make lint
make test
All PHP tooling runs in Docker (php:8.5-cli-bookworm). See WORKFLOWS.md for CI.
Documentation
- docs/README.md — documentation map
- CHANGELOG.md
- CONTRIBUTING.md
- SECURITY.md
License
MIT — see LICENSE.