Skip to main content

Overview

Dashboard Laravel provides a flexible notification system for keeping users informed about important events. Configure email notifications, system alerts, and customize notification preferences through the settings panel.
All notification preferences are saved per user and can be customized individually.

Notification Preferences

Access notification settings through the Notificaciones tab in the configuration panel.
<div class="card">
  <div class="card-header">
    <h5><i class="fas fa-bell"></i> Preferencias de Notificaciones</h5>
  </div>
  <div class="card-body">
    <!-- Notification toggles -->
  </div>
</div>

Email Notifications

Configure which events trigger email notifications.

Available Email Notifications

Business Activity Notifications
<div class="form-check form-switch mb-2">
  <input class="form-check-input" type="checkbox" id="n1" checked>
  <label class="form-check-label" for="n1">Nueva venta realizada</label>
</div>
<div class="form-check form-switch mb-2">
  <input class="form-check-input" type="checkbox" id="n2" checked>
  <label class="form-check-label" for="n2">Nuevo cliente registrado</label>
</div>
  • Nueva venta realizada: Notification when a new sale is completed
  • Nuevo cliente registrado: Alert when a new client signs up
These notifications help you stay informed about business activity in real-time.

System Notifications

Configure alerts related to system events and reports.

Security Alerts

Receive notifications about security-related events:
<h6 class="text-muted mb-3">Notificaciones del Sistema</h6>
<div class="form-check form-switch mb-2">
  <input class="form-check-input" type="checkbox" id="n5" checked>
  <label class="form-check-label" for="n5">Alertas de seguridad</label>
</div>
Security Alert Types:
  • Failed login attempts
  • Password changes
  • New device logins
  • Account access from unusual locations
  • Security setting modifications
It’s strongly recommended to keep security alerts enabled for administrator accounts.

Weekly Reports

Optional summary reports delivered via email:
<div class="form-check form-switch mb-4">
  <input class="form-check-input" type="checkbox" id="n6">
  <label class="form-check-label" for="n6">Reportes semanales</label>
</div>
Weekly reports include:
  • Sales summary and trends
  • New client registrations
  • Revenue statistics
  • Outstanding invoices
  • System performance metrics
  • Key performance indicators (KPIs)
Reports are sent every Monday morning with data from the previous week.

Email Configuration

Configure email delivery settings in config/mail.php.

Mail Driver Setup

// config/mail.php
'default' => env('MAIL_MAILER', 'log'),

'mailers' => [
    'smtp' => [
        'transport' => 'smtp',
        'host' => env('MAIL_HOST', '127.0.0.1'),
        'port' => env('MAIL_PORT', 2525),
        'username' => env('MAIL_USERNAME'),
        'password' => env('MAIL_PASSWORD'),
        'timeout' => null,
    ],
    
    'log' => [
        'transport' => 'log',
        'channel' => env('MAIL_LOG_CHANNEL'),
    ],
],
SMTP Mail Configuration
# .env
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=[email protected]
MAIL_FROM_NAME="${APP_NAME}"
SMTP is the most common mail driver for production environments.

Global From Address

Set the default sender for all outgoing emails:
// config/mail.php
'from' => [
    'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
    'name' => env('MAIL_FROM_NAME', 'Example'),
],

Notification Channels

Laravel supports multiple notification channels beyond email.

Available Channels

Built-in Channels:
ChannelDescriptionUse Case
mailEmail notificationsMost common notification type
databaseStore in databaseIn-app notification center
broadcastReal-time via websocketsLive updates
slackSlack channel messagesTeam collaboration
nexmoSMS messagesCritical alerts
Channels can be combined to send notifications through multiple methods simultaneously.

Saving Preferences

Apply notification changes using the save button:
<button class="btn btn-primary">
  <i class="fas fa-save"></i> Guardar Preferencias
</button>
Changes take effect immediately after saving and apply to future notifications.

In-App Notifications

Dashboard Laravel can display notifications within the interface.

Notification Bell Icon

Access recent notifications through the bell icon in the navigation:
<li class="nav-item">
  <a class="nav-link" href="#">
    <i class="fas fa-bell"></i>
    <span class="badge bg-danger">3</span>
  </a>
</li>
Features:
  • Real-time notification counter
  • Dropdown with recent notifications
  • Mark as read functionality
  • Link to full notification history

Environment Configuration

Key notification-related environment variables:
# .env - Mail Configuration
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
Never commit mail credentials to version control. Use environment variables only.

Testing Notifications

Test your notification configuration:
# Send a test email
php artisan tinker
>>> Notification::route('mail', '[email protected]')
...     ->notify(new TestNotification());

Debugging Email

Check email logs when using the log driver:
# View email log
tail -f storage/logs/laravel.log

Notification Best Practices

Performance & User Experience:
  • Use queue for sending bulk notifications
  • Allow users to control notification frequency
  • Provide clear unsubscribe options
  • Group similar notifications to avoid spam
  • Use appropriate channels for urgency levels
  • Test notifications before production deployment
  • Monitor email delivery rates
  • Keep notification copy concise and actionable
Respect user preferences to maintain engagement and trust.

Queue Configuration

For high-volume notifications, use Laravel’s queue system:
// Send notification via queue
use Illuminate\Bus\Queueable;

class NewSaleNotification extends Notification
{
    use Queueable;
    
    // Notification logic
}
Queued notifications improve application performance by processing notifications asynchronously.

Build docs developers (and LLMs) love