Package

Prologue Alerts

Prologue Alerts is a package that handles global site messages.

Package

prologue/alerts

View on GitHub →

Prologue Alerts for Laravel

Prologue Alerts is a Laravel package designed to facilitate the creation and management of global site messages across Laravel versions 5 through 9. It leverages an intuitive API for triggering notification bubbles that can be displayed immediately or flashed to the session for future display.

Key Features:

  • Compatibility: Supports Laravel versions 5 to 9, ensuring broad usability across different projects.
  • Ease of Use: Utilizes a simple API to add alerts via predefined or custom alert levels such as success, error, warning, and info.
  • Flexibility: Alerts can be added directly or flashed to the session for display after redirects, enhancing user experience in multi-page scenarios.
  • Integration: Extends Illuminate’s MessageBag class, allowing for the use of all its methods to manage messages efficiently.
  • Customizable Alert Levels: Comes with default alert levels and allows for the addition of custom levels through configuration modifications.

Installation:

For Laravel 6 and newer:

composer require prologue/alerts

For Laravel 5.4 and below, registration of the service provider and facade is necessary in app/config/app.php:

'Prologue\Alerts\AlertsServiceProvider',
'Alert' => 'Prologue\Alerts\Facades\Alert',

Configuration:

Generate the configuration file with:

php artisan vendor:publish --provider="Prologue\Alerts\AlertsServiceProvider"

This action creates a config file at config/prologue/alerts.php where custom alert levels and other settings can be defined.

Usage Highlights:

  • Adding Alerts: Simple API to add messages.
    Alert::error('Error message');
    
  • Flashing Alerts: Store alerts in the session to be displayed after a redirect.
    Alert::success('You have successfully logged in')->flash();
    
  • Displaying Alerts: Use Laravel’s view system to loop through and display alerts.
    @foreach (Alert::all() as $alert)
        {{ $alert }}
    @endforeach
    

Practical Applications:

  • Check for the presence of alerts, useful for conditionally loading resources.
  • Count alerts by type, aiding in granular control over alert handling.

Credits: Developed by Dries Vints, with ongoing maintenance by Cristian Tabacitu, this package is inspired by concepts from Todd Francis and integrates seamlessly with Laravel's ecosystem.

This package is ideal for developers looking to implement responsive, session-based notification systems in their Laravel applications, streamlining the user experience with minimal setup.

Prologue Alerts Related Articles

Laravel Google Chat Alerts image

Laravel Google Chat Alerts

Read article
Laravel Slack Alerts Package image

Laravel Slack Alerts Package

Read article
Creating Alerts in Understand.io image

Creating Alerts in Understand.io

Read article
Slow Job Alerts and Replica Commit IDs in Laravel 13.40 image

Slow Job Alerts and Replica Commit IDs in Laravel 13.40

Read article
Building Cross-Platform Alerts with Laravel's Notification Framework image

Building Cross-Platform Alerts with Laravel's Notification Framework

Read article
Resources for Getting Up To Speed with Laravel 11 image

Resources for Getting Up To Speed with Laravel 11

Read article

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing