PHPackages                             alizharb/flare - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. alizharb/flare

ActiveLibrary

alizharb/flare
==============

A beautiful, performant toast notification package for Laravel Livewire with real-time support

v1.1.0(5mo ago)7141MITPHPPHP ^8.3CI passing

Since Oct 5Pushed 5mo agoCompare

[ Source](https://github.com/AlizHarb/flare)[ Packagist](https://packagist.org/packages/alizharb/flare)[ RSS](/packages/alizharb-flare/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (3)Used By (0)

[![Flare Logo](https://raw.githubusercontent.com/alizharb/flare/main/art/logo.svg)](https://raw.githubusercontent.com/alizharb/flare/main/art/logo.svg)Flare
=====

[](#flare)

### Production-Ready Toast Notifications for Laravel Livewire

[](#production-ready-toast-notifications-for-laravel-livewire)

**Elegant • Performant • Customizable**

[![PHP Version](https://camo.githubusercontent.com/9bf67f86d575c87bf6c023686d5e5a831f629a94a3bac355486e709814df4648/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d3737374242343f7374796c653d666c61742d737175617265266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php.net)[![Laravel](https://camo.githubusercontent.com/3657465c1347505c495fe6f48e7073fe7a4b4e8018cb289a3330a3031a2bc5f4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e302532422d4646324432303f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![Livewire](https://camo.githubusercontent.com/f65b6d715e21779bf012cc119eb8bb1b12e8c07fd51f2aef591f706a5f05faa9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c697665776972652d332e352532422d3445353641363f7374796c653d666c61742d737175617265266c6f676f3d6c69766577697265266c6f676f436f6c6f723d7768697465)](https://livewire.laravel.com)[![Tests](https://camo.githubusercontent.com/f70687a69e664e1a628c047d8166482489b4f4db3b3831ec80bf44df7da2adf9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616c697a686172622f666c6172652f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/alizharb/flare/actions)[![License](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Downloads](https://camo.githubusercontent.com/f5b7fd1cd54f3b618b6ce812cee1f185c7568a71f0a5a44f073cf708ae813c1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c697a686172622f666c6172653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/alizharb/flare)

[Features](#-features) • [Installation](#-installation) • [Quick Start](#-quick-start) • [Documentation](#-documentation) • [Themes](#-themes) • [Examples](#-examples)

---

🎯 Overview
----------

[](#-overview)

Flare is a modern, feature-rich toast notification system built specifically for Laravel Livewire applications. With **zero configuration** required and **three distinct visual themes**, Flare provides beautiful user feedback out of the box while offering extensive customization for advanced use cases.

👉 **[Try the Live Playground](https://alizharb.github.io/flare/playground.html)**

```
// Simple, elegant API
Flare::success('Profile updated successfully!');

// Full control when you need it
Flare::warning(
    text: 'Session expires in 5 minutes',
    heading: 'Warning',
    duration: 10000,
    position: 'top center'
);
```

---

✨ Features
----------

[](#-features)

### 🎨 **Three Professional Themes**

[](#-three-professional-themes)

- **Classic** - Minimal, clean, fastest performance
- **Modern** - Balanced design with subtle effects *(default)*
- **Vibrant** - Bold, colorful, attention-grabbing

All themes include:

- ✓ Light &amp; dark mode support
- ✓ Smooth animations
- ✓ Responsive design
- ✓ RTL/LTR layouts

### ⚡ **High Performance**

[](#-high-performance)

- Alpine.js powered (minimal overhead)
- Optimized CSS transitions
- Smart caching &amp; compilation
- No jQuery dependency
- Lightweight footprint (~15KB)

### 🔧 **Developer Experience**

[](#-developer-experience)

- **Zero Configuration** - Works out of the box
- **Simple API** - Intuitive, clean methods
- **Livewire Trait** - `use WithFlare`
- **TypeScript Support** - Full type definitions
- **IDE Autocomplete** - PHPDoc annotations

### 📍 **Flexible Positioning**

[](#-flexible-positioning)

- 6 position options (top/bottom × start/center/end)
- Per-toast position override
- RTL/LTR automatic adaptation
- Responsive mobile behavior

### 🎭 **Advanced Features**

[](#-advanced-features)

- **Stacking System** - Configurable toast layering
- **Auto-Dismiss** - Configurable duration
- **Hover Pause** - Pause on mouse hover
- **Keyboard Shortcuts** - Esc, Shift+Esc, Alt+D
- **Progress Bar** - Visual countdown
- **Queue Management** - Handle multiple toasts

### 🧪 **Production Ready**

[](#-production-ready)

- ✓ Comprehensive test suite (12 tests, 22 assertions)
- ✓ PHPStan Level 9 compliance
- ✓ PSR-12 code style
- ✓ CI/CD with GitHub Actions
- ✓ Semantic versioning
- ✓ Extensive documentation

---

📋 Requirements
--------------

[](#-requirements)

RequirementVersion**PHP**8.3+**Laravel**12.0+**Livewire**3.5+**Alpine.js**3.x *(included in Livewire 3)*---

🚀 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require alizharb/flare
```

### Step 2: Publish Assets

[](#step-2-publish-assets)

> **IMPORTANT**: Assets must be published for Flare to work.

```
php artisan vendor:publish --tag=flare-assets
```

### Step 3: Add to Layout

[](#step-3-add-to-layout)

```

    @flareStyles {{-- Required --}}

     {{-- Required --}}

    @flareScripts {{-- Required --}}

```

**That's it!** 🎉 You're ready to use Flare.

**Optional Configuration**```
# Publish config file
php artisan vendor:publish --tag=flare-config

# Publish views for customization
php artisan vendor:publish --tag=flare-views
```

---

⚡ Quick Start
-------------

[](#-quick-start)

### Using the Facade

[](#using-the-facade)

Perfect for controllers, services, and any PHP class:

```
use AlizHarb\Flare\Facades\Flare;

class UserController extends Controller
{
    public function store(Request $request)
    {
        User::create($request->validated());

        Flare::success('User created successfully!');

        return redirect()->route('users.index');
    }
}
```

### Using the Livewire Trait

[](#using-the-livewire-trait)

The easiest way in Livewire components:

```
use Livewire\Component;
use AlizHarb\Flare\Concerns\WithFlare;

class CreatePost extends Component
{
    use WithFlare;

    public function save()
    {
        Post::create($this->validate());

        $this->flareSuccess('Post published!', 'Success');
    }
}
```

### Using JavaScript

[](#using-javascript)

For client-side notifications:

```
// Simple
Flare.success("Item added to cart!");

// Advanced
Flare.toast("Welcome back!", {
    heading: "Hello User",
    variant: "info",
    duration: 5000,
    position: "top center",
});
```

---

🎨 Themes
--------

[](#-themes)

Flare includes three professionally designed themes. Choose the one that fits your application's aesthetic.

### Classic

[](#classic)

**Minimal &amp; Professional**

Solid backgrounds
Single shadow
No blur
⚡ Fastest

```
'theme' => 'classic'
```

### Modern

[](#modern)

**Balanced &amp; Contemporary**

Subtle gradients
Light blur (4px)
2 shadow layers
⚡ Fast *(default)*

```
'theme' => 'modern'
```

### Vibrant

[](#vibrant)

**Bold &amp; Colorful**

Strong gradients
Glowing shadows
Moderate blur (8px)
⚡ Good

```
'theme' => 'vibrant'
```

**All themes support light &amp; dark modes automatically.**

---

📚 Documentation
---------------

[](#-documentation)

### 📖 Complete Documentation

[](#-complete-documentation)

Visit our comprehensive documentation:

- **[Introduction](docs/introduction.md)** - What is Flare?
- **[Installation](docs/installation.md)** - Detailed setup guide
- **[Quick Start](docs/quick-start.md)** - Get started in 5 minutes
- **[Playground](https://alizharb.github.io/flare/playground.html)** - Try it live
- **[Themes](docs/themes.md)** - Visual customization
- **[Configuration](docs/configuration.md)** - All options explained
- **[Examples](EXAMPLES.md)** - Real-world scenarios

### 🌐 Interactive Docs

[](#-interactive-docs)

Run the documentation website locally:

```
php -S localhost:8000 -t docs
```

Visit `http://localhost:8000` for interactive documentation.

---

💡 API Reference
---------------

[](#-api-reference)

### Toast Variants

[](#toast-variants)

```
Flare::success($text, $heading = null, $duration = 5000, $position = null);
Flare::warning($text, $heading = null, $duration = 5000, $position = null);
Flare::danger($text, $heading = null, $duration = 5000, $position = null);
Flare::error($text, $heading = null, $duration = 5000, $position = null); // Alias
Flare::info($text, $heading = null, $duration = 5000, $position = null);
```

### Livewire Trait Methods

[](#livewire-trait-methods)

```
$this->flareSuccess($text, $heading = null, $duration = 5000, $position = null);
$this->flareWarning($text, $heading = null, $duration = 5000, $position = null);
$this->flareDanger($text, $heading = null, $duration = 5000, $position = null);
$this->flareError($text, $heading = null, $duration = 5000, $position = null);
$this->flareInfo($text, $heading = null, $duration = 5000, $position = null);
```

### JavaScript API

[](#javascript-api)

```
Flare.toast(text, options);
Flare.success(text, options);
Flare.warning(text, options);
Flare.danger(text, options);
Flare.error(text, options);
Flare.info(text, options);
```

---

⚙️ Configuration
----------------

[](#️-configuration)

**View Complete Configuration**```
return [
    // Visual theme
    'theme' => 'modern', // classic, modern, vibrant

    // Default position
    'position' => 'bottom end',

    // Default duration (ms)
    'duration' => 5000,

    // Stacking behavior
    'enable_stacking' => true,
    'stack_expanded' => false,
    'max_visible' => 3,

    // Features
    'icons' => ['enabled' => true],
    'actions' => ['enabled' => true],
    'priority' => ['enabled' => true],
    'rate_limit' => ['enabled' => true],
    'progress_bar' => ['enabled' => true],
];
```

### Environment Variables

[](#environment-variables)

```
FLARE_THEME=modern
FLARE_POSITION="bottom end"
FLARE_DURATION=5000
FLARE_ENABLE_STACKING=true
FLARE_STACK_EXPANDED=false
```

---

🎯 Examples
----------

[](#-examples)

### Form Validation

[](#form-validation)

```
class ContactForm extends Component
{
    use WithFlare;

    public function submit()
    {
        $this->validate([...]);

        // Send email...

        $this->flareSuccess(
            text: "Thank you! We'll get back to you soon.",
            heading: 'Message Sent',
            duration: 7000
        );
    }
}
```

### CRUD Operations

[](#crud-operations)

```
public function destroy(Post $post)
{
    $post->delete();

    Flare::danger(
        text: 'Post has been permanently deleted',
        heading: 'Deleted',
        duration: 4000
    );

    return redirect()->route('posts.index');
}
```

### Persistent Notifications

[](#persistent-notifications)

```
// Requires manual dismissal
Flare::danger(
    text: 'Critical error - please contact support',
    heading: 'Error',
    duration: 0 // Never auto-dismiss
);
```

**See [EXAMPLES.md](EXAMPLES.md) for more real-world scenarios.**

---

⌨️ Keyboard Shortcuts
---------------------

[](#️-keyboard-shortcuts)

ShortcutAction`Esc`Dismiss most recent toast`Shift + Esc`Dismiss all toasts`Alt + D`Dismiss all toasts *(alternative)*---

🧪 Testing
---------

[](#-testing)

Flare includes a comprehensive test suite:

```
# Run tests
composer test

# Run tests with coverage
composer test:coverage

# Run static analysis
composer analyse

# Run code style fixer
composer format
```

**Test Results:** ✅ 12 tests, 22 assertions, 100% passing

---

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

### Development Setup

[](#development-setup)

```
git clone https://github.com/alizharb/flare.git
cd flare
composer install
composer test
```

---

📝 Changelog
-----------

[](#-changelog)

See [CHANGELOG.md](CHANGELOG.md) for all changes and version history.

### Latest Release: v1.1.0

[](#latest-release-v110)

- ✨ Three distinct themes (Classic, Modern, Vibrant)
- 🐛 Fixed all positioning issues
- ⚡ Improved stacking performance
- 🌍 Added RTL/LTR support
- 📚 Complete documentation

---

📄 License
---------

[](#-license)

Flare is open-source software licensed under the [MIT License](LICENSE).

---

🙏 Credits
---------

[](#-credits)

**Built with ❤️ by [Ali Harb](https://github.com/alizharb)**

Special thanks to:

- Laravel &amp; Livewire teams
- Alpine.js community
- All contributors

---

🌟 Support
---------

[](#-support)

If you find Flare useful, please consider:

- ⭐ Starring the repository
- 🐛 Reporting bugs
- 💡 Suggesting features
- 📖 Improving documentation
- 💰 [Sponsoring development](https://github.com/sponsors/alizharb)

---

**[⬆ Back to Top](#flare)**

Made with ❤️ for the Laravel community

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance76

Regular maintenance activity

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~49 days

Total

2

Last Release

166d ago

PHP version history (2 changes)v1.0.0PHP ^8.4

v1.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/aa785764ac84cfd4a3237f3d4a3471ce97b479ac6fa2171a5ea8bf369c2377e5?d=identicon)[AlizHarb](/maintainers/AlizHarb)

---

Top Contributors

[![AlizHarb](https://avatars.githubusercontent.com/u/34816428?v=4)](https://github.com/AlizHarb "AlizHarb (2 commits)")

---

Tags

laravelnotificationslivewirealertsalpineflash-messagestoast

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/alizharb-flare/health.svg)

```
[![Health](https://phpackages.com/badges/alizharb-flare/health.svg)](https://phpackages.com/packages/alizharb-flare)
```

###  Alternatives

[ascsoftw/livewire-toast

Livewire Package to display Toast Notifications

48544.2k1](/packages/ascsoftw-livewire-toast)[tanthammar/livewire-window-size

Laravel blade directives and php helpers for serverside rendered content, based on browser window size WITHOUT css. Requires Livewire and AlpineJS

2321.0k](/packages/tanthammar-livewire-window-size)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

116.6k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
