PHPackages                             mylaraveltools/alertas - 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. [Templating &amp; Views](/categories/templating)
4. /
5. mylaraveltools/alertas

ActiveLibrary[Templating &amp; Views](/categories/templating)

mylaraveltools/alertas
======================

Alertas modales y toasts estilo SweetAlert para Laravel — My Laravel Tools

00PHP

Since Jun 20Pushed todayCompare

[ Source](https://github.com/gallardev98-blip/alerts)[ Packagist](https://packagist.org/packages/mylaraveltools/alertas)[ RSS](/packages/mylaraveltools-alertas/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Alertas — My Laravel Tools
==========================

[](#alertas--my-laravel-tools)

Parte del ecosistema **My Laravel Tools** (`mylaraveltools/*`). Alertas modales y toasts estilo **SweetAlert** para Laravel. Sin dependencias JavaScript externas — usa **Alpine.js** (incluido con Livewire 3).

```
composer require mylaraveltools/alertas
```

Requisitos
----------

[](#requisitos)

- PHP 8.2+
- Laravel 11, 12 o 13
- Alpine.js en el layout (Livewire 3 lo incluye)

Instalación
-----------

[](#instalación)

```
composer require mylaraveltools/alertas
php artisan alertas:install
```

Repositorio local (desarrollo):

```
{
  "repositories": [
    { "type": "path", "url": "../alertas-library" }
  ],
  "require": {
    "mylaraveltools/alertas": "@dev"
  }
}
```

### Layout

[](#layout)

Añade el contenedor antes de ``:

```
@alertas
```

o:

```

```

Uso
---

[](#uso)

### Controlador (redirect con flash)

[](#controlador-redirect-con-flash)

```
use MyLaravelTools\Alertas\Facades\Alertas;

Alertas::exito('Guardado', 'Los cambios se aplicaron.');

return redirect()->back();
```

Atajos: `Alertas::error()`, `Alertas::aviso()`, `Alertas::info()`, `Alertas::toast('Mensaje', 'exito')`.

### Livewire

[](#livewire)

```
use MyLaravelTools\Alertas\Livewire\Concerns\DispatchaAlertas;
use MyLaravelTools\Alertas\Livewire\Concerns\EscuchaConfirmacionAlertas;

class MiComponente extends Component
{
    use DispatchaAlertas, EscuchaConfirmacionAlertas;

    public function guardar(): void
    {
        // ...
        $this->alertaExito('Guardado');
    }

    public function pedirBorrado(int $id): void
    {
        $this->alertaConfirmar('¿Eliminar?', 'No se puede deshacer', 'borrar', ['id' => $id]);
    }

    public function borrar(array $datos): void
    {
        // $datos['id']
        $this->alertaExito('Eliminado');
    }
}
```

### JavaScript

[](#javascript)

Tras cargar la página, `window.Alertas` está disponible:

```
// Modal simple
await Alertas.exito('¡Hecho!', 'Registro guardado')

// Confirmación (Promise)
const ok = await Alertas.confirmar('¿Continuar?', 'Esta acción no se puede deshacer')
if (ok) { /* ... */ }

// Prompt con entrada
const nombre = await Alertas.prompt('Tu nombre', 'Introduce tu nombre', 'Ej: Ana')

// Toast
Alertas.toast('Copiado al portapapeles', 'info')

// API completa (alias en inglés compatibles)
Alertas.fire({ title: 'Hola', text: 'Mundo', icon: 'success', toast: true })
```

Configuración
-------------

[](#configuración)

Publicada en `config/alertas.php`:

ClaveDescripción`botones.confirmar` / `cancelar`Textos por defecto`toast.posicion``top-start`, `top-end`, `bottom-start`, `bottom-end``toast.duracion`ms antes de cerrar toast`tema``claro`, `oscuro`, `auto``colores.*`Variables CSS por tipo de alertaTipos de icono
--------------

[](#tipos-de-icono)

`exito` · `error` · `aviso` · `info` · `pregunta`

Alias en inglés: `success`, `warning`, `question`.

Licencia
--------

[](#licencia)

MIT — Alberto Gallardo Morales

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/mylaraveltools-alertas/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[wmde/php-vuejs-templating

PHP implementation of Vue.js templating engine

3041.6k2](/packages/wmde-php-vuejs-templating)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)[awkwardideas/switchblade

Extended blade directives for laravel

102.1k](/packages/awkwardideas-switchblade)

PHPackages © 2026

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