Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Jolinotif Laravel Package

jolicode/jolinotif

JoliNotif is a cross-platform PHP library for displaying desktop notifications from CLI scripts and CRON jobs on Linux, Windows (including WSL), and macOS. Install via Composer and send customizable notifications with title, body, icon, and driver-specific options. Requires PHP 8.3 or newer.

View on GitHub
Deep Wiki
Context7

JoliNotif is a cross-platform PHP library for displaying desktop notifications from your scripts. It works on Linux, Windows (WSL included), and macOS, automatically selecting the right driver for the current environment. Requires PHP >= 8.3 and is intended for CLI contexts — not web/FPM.

(new DefaultNotifier())->send(
    (new Notification())->setTitle('Hello')->setBody('World')
);
  • Cross-platform drivers for Linux, Windows, WSL, and macOS
  • Fluent Notification API with title, body, and icon
  • Platform-specific options such as subtitle and sound
  • CLI executable (jolinotif) and easy CRON integration
Frequently asked questions about Jolinotif
Can I use jolicode/jolinotif in a Laravel controller or web request?
No. The library explicitly states it cannot be used in a web context such as FPM, because it shells out to OS binaries and needs an interactive desktop session and notification daemon. In a web request it will typically no-op or fail without a useful signal. Use it only in CLI scripts, artisan commands or CRON jobs, and guard the call with app()->runningInConsole().
How do I install JoliNotif in a Laravel application with Composer?
Run composer require jolicode/jolinotif, preferably with --dev since it is a developer-productivity and local-ops tool rather than an application capability. Pin ^3.4.1 or higher to get the security fixes for argument and script injection. Then create a thin wrapper service such as App\Support\DesktopNotifier, bind it as a singleton in a service provider, and drive it from a config flag like config/desktop-notifications.php.
Which PHP and Laravel versions does jolicode/jolinotif support?
JoliNotif requires PHP 8.3 or newer, and older PHP support only exists in older releases. It is framework-agnostic but supports Symfony 6.4, 7.x and 8.0 per the changelog, so Laravel 11 and 12 projects meet the floor comfortably. Legacy Laravel apps pinned to PHP 8.2 or below cannot use the current major and would need an older JoliNotif release.
Does JoliNotif work inside Docker, Laravel Sail, or headless CI environments?
Usually not. Success depends on available binaries, an interactive desktop session and a DBus or notification daemon, so headless CI, Docker, Sail and DDEV will typically no-op or fail silently. Containerized dev stacks either need a DBus socket mount to the host or should invoke the shipped jolinotif CLI binary on the host instead. Plan for driver availability as an environment property, not a code property.
How do I send desktop notifications from a Laravel artisan command or scheduled task?
Build a Notification with title, body and icon, pass it to DefaultNotifier::send(), and call that from an artisan command or scheduled task invoked by CRON. Keep the wrapper behind a config flag, a runningInConsole() guard, and PSR-3 logging that never throws. Remember delivery is best-effort: send() returns a boolean, so treat it as fire-and-forget developer feedback.
Which drivers does JoliNotif use for notifications on Linux, macOS and Windows?
On Linux it delegates to libnotify, notify-send or kdialog; on macOS to AppleScript and terminal-notifier; on Windows and WSL to PowerShell, SnoreToast or Notifu. The DefaultNotifier picks a driver per platform and executes it through Symfony Process. Extra options such as subtitle and sound are driver-specific, so scope to title, body and icon if you need portability.
How do I test code that sends desktop notifications with JoliNotif?
Because send() only returns a boolean and is effectively fire-and-forget, test your own abstraction rather than real OS notifications. Bind a fake notifier implementation behind your DesktopNotifier interface in the test container, then assert that your command dispatched the expected title and body and that failures are logged instead of thrown. Avoid asserting on actual desktop notifications in CI, where no daemon exists.
Is jolicode/jolinotif suitable for production alerting, or only developer feedback?
It is not suitable for anything requiring guaranteed alerting. There is no acknowledgement, retry or delivery audit, and send() returning true does not prove the user saw anything. For production job monitoring or on-call alerting, pair your logs with Slack, email or a webhook channel. JoliNotif fits developer productivity and local workstation ops alerts.
Which version of jolicode/jolinotif should I pin for security, and is it maintained?
Pin jolicode/jolinotif:^3.4.1 or higher. Version 3.4.1 fixed argument injection in NotifySendDriver, Unicode-quote script injection in PowerShellDriver, and cross-user PHAR resource tampering, so older tags should be avoided. The package is maintained by JoliCode and drops old PHP and Symfony majors with each release, so check the changelog before upgrading. Record the security rationale next to the constraint in composer.json.
What are the alternatives to jolicode/jolinotif for Laravel notifications?
For application notifications, use Laravel's built-in channels such as mail, database, Slack or custom webhooks, which offer delivery tracking and queueing. If you only need a local popup from CLI, calling notify-send, terminal-notifier or PowerShell directly works but loses the cross-platform driver abstraction JoliNotif provides. JoliNotif is the reasonable choice when you specifically want a desktop notification from a console script or CRON job.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core