wahyudedik / laravel-alert
A beautiful and easy-to-use alert notification library for Laravel with Blade integration
Fund package maintenance!
wahyudedik
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/wahyudedik/laravel-alert
Requires
- php: ^8.1
- illuminate/cache: ^9.0|^10.0|^11.0
- illuminate/database: ^9.0|^10.0|^11.0
- illuminate/mail: ^9.0|^10.0|^11.0
- illuminate/queue: ^9.0|^10.0|^11.0
- illuminate/redis: ^9.0|^10.0|^11.0
- illuminate/session: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- illuminate/view: ^9.0|^10.0|^11.0
- predis/predis: ^2.0
- pusher/pusher-php-server: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- laravel/dusk: ^7.0|^8.0
- mockery/mockery: ^1.0
- orchestra/testbench: ^7.0|^8.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^9.0|^10.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2025-12-24 19:19:31 UTC
README
A comprehensive Laravel package for managing alerts and notifications with support for multiple themes, animations, and real-time updates.
โจ Features
- Multiple Alert Types - Success, Error, Warning, Info
- Blade Integration - Components and Directives
- Multiple Themes - Bootstrap, Tailwind, Bulma
- Animations - Fade, Slide, Bounce, and more
- Real-time Updates - WebSocket and AJAX support
- Database Storage - Persistent alert storage
- Cache Integration - Redis and Cache support
- REST API - Full API support with authentication
- Admin Panel - Alert management interface
- Performance Optimization - High-performance features
Installation
composer require wahyudedik/laravel-alert
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Wahyudedik\LaravelAlert\AlertServiceProvider" --tag="laravel-alert-config"
Usage
Using the Facade
use Wahyudedik\LaravelAlert\Facades\Alert; // Success alert Alert::success('Operation completed successfully!'); // Error alert Alert::error('Something went wrong!'); // Warning alert Alert::warning('Please check your input.'); // Info alert Alert::info('Welcome to our application!'); // Custom alert Alert::add('custom', 'This is a custom alert!');
Using Blade Components
<!-- Single alert --> <x-alert type="success" dismissible> Your changes have been saved! </x-alert> <!-- Display all alerts --> <x-alerts />
Using Blade Directives
<!-- Single alert directive --> @alert('info', 'Welcome to our application!') <!-- Display all alerts --> @alerts <!-- Conditional alert --> @alertIf($user->isNew(), 'success', 'Welcome to our platform!')
Configuration Options
// config/laravel-alert.php return [ 'default_theme' => 'bootstrap', // bootstrap, tailwind, bulma 'auto_dismiss' => true, 'dismiss_delay' => 5000, // milliseconds 'animation' => 'fade', // fade, slide, bounce, none 'position' => 'top-right', // top-right, top-left, bottom-right, bottom-left, top-center, bottom-center 'max_alerts' => 5, 'session_key' => 'laravel_alerts', ];
Themes
Bootstrap
<x-alert type="success">Success message</x-alert> <x-alert type="error">Error message</x-alert> <x-alert type="warning">Warning message</x-alert> <x-alert type="info">Info message</x-alert>
Tailwind CSS
<x-alert type="success" class="bg-green-50 text-green-800 border-green-200"> Success message </x-alert>
Advanced Usage
Custom Options
Alert::success('Message', 'Title', [ 'dismissible' => true, 'icon' => 'fas fa-check', 'class' => 'custom-alert-class', 'style' => 'border-left: 4px solid #28a745;' ]);
Custom Themes
You can create custom themes by publishing the views:
php artisan vendor:publish --provider="Wahyudedik\LaravelAlert\AlertServiceProvider" --tag="laravel-alert-views"
Requirements
- PHP 8.0+
- Laravel 9.0+
- Bootstrap 4/5 (for Bootstrap theme)
- Tailwind CSS (for Tailwind theme)
License
MIT License. See LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ Documentation
๐ Complete Documentation
For comprehensive documentation, visit our documentation site.
๐ Documentation Structure
docs/
โโโ README.md # Main documentation index
โโโ installation.md # Installation guide
โโโ api.md # API documentation
โโโ examples.md # Code examples
โโโ contributing.md # Contributing guide
โโโ changelog.md # Version history
โโโ mkdocs.yml # MkDocs configuration
โโโ package.json # Node.js dependencies
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Docker configuration
โโโ docker-compose.yml # Docker Compose configuration
โโโ Makefile # Build automation
โโโ .gitignore # Git ignore rules
๐ ๏ธ Documentation Development
The documentation is built using MkDocs with the Material theme.
Local Development
# Navigate to docs directory cd docs/ # Install dependencies make install # Start development server make dev # Build documentation make build # Deploy to GitHub Pages make deploy
Docker Development
# Start with Docker make docker-dev # Build with Docker make docker-build # Deploy with Docker make docker-deploy
Available Commands
make help # Show all available commands make dev # Start development server make build # Build documentation make deploy # Deploy to GitHub Pages make clean # Clean build files make lint # Lint markdown files make spell # Check spelling make test # Run tests make preview # Preview built documentation
๐ฏ Key Features
Core Features
- โ Multiple Alert Types - Success, Error, Warning, Info
- โ Blade Integration - Components and Directives
- โ Multiple Themes - Bootstrap, Tailwind, Bulma
- โ Animations - Fade, Slide, Bounce, and more
- โ Auto-dismiss - Configurable auto-dismissal
- โ Session Storage - Built-in session management
Advanced Features
- โ Database Storage - Persistent alert storage
- โ Cache Integration - Redis and Cache support
- โ REST API - Full API support
- โ Real-time Updates - WebSocket integration
- โ Admin Panel - Alert management interface
- โ Performance Optimization - High-performance features
Integration Features
- โ Third-party Services - Pusher, WebSocket, Email
- โ Authentication - Multiple auth methods
- โ Rate Limiting - Built-in rate limiting
- โ CORS Support - Cross-origin requests
- โ Webhook Support - External integrations
๐ก API Usage
# Get all alerts GET /api/v1/alerts # Create alert POST /api/v1/alerts { "type": "success", "message": "Operation completed!", "title": "Success" } # Dismiss alert POST /api/v1/alerts/{id}/dismiss
๐งช Testing
# Run tests composer test # Run with coverage composer test-coverage # Run performance tests composer test-performance
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Support
๐ Statistics
- Version: 1.0.0
- PHP Version: 8.1+
- Laravel Version: 9.0+
- License: MIT
- Stars: โญ (GitHub)
- Downloads: ๐ฆ (Packagist)
Made with โค๏ธ by Wahyudedik