Skip to content

Spark CLI Commands ​

jengo/notifications comes with dedicated Spark CLI commands for installation, generation, and diagnostic testing.


1. Automated Installer (jengo:install) ​

Run the complete setup process with zero configuration:

bash
php spark jengo:install notifications

Options:

  • --force, --overwrite: Overwrite existing configuration files and re-run migrations.

2. Notification Subsystem Manager (jengo:notifications) ​

Manage and inspect the state of the notifications engine:

bash
# Run installer
php spark jengo:notifications install

# Check environment health, configuration, and database table readiness
php spark jengo:notifications status

Sample status output:

text
  Jengo Notifications Subsystem Status
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Configuration:  Config/Notifications.php present
  Database Table: [notifications] Active (verified)
  cURL Extension: Loaded (SMS/Push/Slack ready)

3. Scaffolding Notifications (make:notification) ​

Generate a new notification class in app/Notifications/:

bash
php spark make:notification InvoiceReminder

This creates a pre-formatted notification class implementing via(), toMail(), toDatabase(), and toSms().


4. Scaffolding the Migration (notifications:table) ​

Generate a custom migration file for the notifications database table:

bash
php spark notifications:table

Options:

  • --table: Specify a custom table name (default: notifications).
bash
php spark notifications:table --table=system_alerts

5. Testing Channels (notifications:test) ​

Verify your credentials, carrier gateways, and webhook URLs in real time by dispatching a test payload:

bash
php spark notifications:test <channel> <recipient>

Examples ​

Test Email Delivery:

bash
php spark notifications:test mail dev@example.com

Test SMS Carrier Gateway (SMSGate / Africa's Talking / Twilio):

bash
php spark notifications:test sms +254712345678

Test In-App Database Notifications:

bash
php spark notifications:test database 1

Test Slack Incoming Webhook:

bash
php spark notifications:test slack https://hooks.slack.com/services/XXX/YYY/ZZZ

Test Outgoing Webhook:

bash
php spark notifications:test webhook https://my-app.com/api/webhook-receiver

Released under the MIT License.