PHPackages                             buivanhuy/sweetalert-laravel - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. buivanhuy/sweetalert-laravel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

buivanhuy/sweetalert-laravel
============================

SweetAlert2 integration for Laravel (supports Livewire, Blade)

v1.2.1(7mo ago)214MITPHPPHP &gt;=8.0

Since Aug 2Pushed 7mo agoCompare

[ Source](https://github.com/BuiVanHuy001/sweetalert-laravel)[ Packagist](https://packagist.org/packages/buivanhuy/sweetalert-laravel)[ RSS](/packages/buivanhuy-sweetalert-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

SweetAlert Laravel
==================

[](#sweetalert-laravel)

**SweetAlert Laravel** is a simple integration package that brings [SweetAlert2](https://sweetalert2.github.io/) into your Laravel application with minimal setup. This package allows you to easily use Sweetalert from both **Blade** and **Livewire**, without the need to manually install SweetAlert2 via npm or configure imports.

Installation
------------

[](#installation)

To install the SweetAlert Laravel package, you can use Composer. Run the following command in your terminal at the root of your Laravel project:

```
composer require buivanhuy/sweetalert-laravel
php artisan vendor:publish --tag=public
```

Note

This will publish the SweetAlert2 assets to your public/vendor/sweetalert2 directory.

Include `swal:index` your layout file

```
@include('swal::index')
```

#### Example layout file

[](#example-layout-file)

```
>

        @include('swal::index')
        Web title

```

Usage
-----

[](#usage)

### Displaying via session

[](#displaying-via-session)

In your controller:

```
// Using the Swal facade
use SweetAlert\Swal;

Swal::fire([
    'icon' => 'success',
    'title' => 'Success!',
    'text' => 'Your action was successful.',
]);

// Or
return redirect()->back()->with('swal', [
    'icon' => 'success',
    'title' => 'Success!',
    'text' => 'Your action was successful.',
]);
```

#### Displaying via Livewire

[](#displaying-via-livewire)

In your Livewire component:

```
public function someAction()
{
    $this->dispatch('swal', [
        'icon' => 'success',
        'title' => 'Success!',
        'text' => 'Your action was successful.',
    ]);
}
```

The full list of options can be found in the [SweetAlert2 documentation](https://sweetalert2.github.io/#configuration).

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance65

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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 ~22 days

Total

4

Last Release

214d ago

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

v1.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/03d2b3c15815e9b20815c167a01c9306f338cdbcf2365e95ae24449831a602d5?d=identicon)[BuiVanHuy001](/maintainers/BuiVanHuy001)

---

Top Contributors

[![BuiVanHuy001](https://avatars.githubusercontent.com/u/166512163?v=4)](https://github.com/BuiVanHuy001 "BuiVanHuy001 (24 commits)")

### Embed Badge

![Health badge](/badges/buivanhuy-sweetalert-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/buivanhuy-sweetalert-laravel/health.svg)](https://phpackages.com/packages/buivanhuy-sweetalert-laravel)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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