PHPackages                             faisalahsan/laraalerts - 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. faisalahsan/laraalerts

ActiveLibrary

faisalahsan/laraalerts
======================

Laravel JS alerts/ toasts

V1.0.2(10y ago)424PHP

Since Apr 5Pushed 10y ago1 watchersCompare

[ Source](https://github.com/faisalahsan/lara-alerts)[ Packagist](https://packagist.org/packages/faisalahsan/laraalerts)[ RSS](/packages/faisalahsan-laraalerts/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

LaraAlerts
==========

[](#laraalerts)

A laravel alerts utility that help you show `Toasts` directly in your blade template instead of Javascript files.

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

[](#installation)

Follow below steps

###### Step :- 1

[](#step---1)

- Run `composer require faisalahsan/laraalerts` in your terminal

###### Step :- 2

[](#step---2)

- **Add Service Provider**Open `config/app.php` and add `FaisalAhsan\LaraAlerts\LaraAlertServiceProvider::class` to the end of `providers` array:

    ```
    'providers' => array(
        ....
        FaisalAhsan\LaraAlerts\LaraAlertServiceProvider::class,
    ),

    ```
- **Register Facade**

    ```
    'aliases' => array(
        ....
        'Toast'    =>  FaisalAhsan\LaraAlerts\Facade\ToastFacade::class,
    ),

    ```
- **Run below command**

    ```
      php artisan vendor:publish

    ```

###### Step :- 3

[](#step---3)

- **Include files in your layout**

    ```

    ```

How to use
----------

[](#how-to-use)

- In you `blade template`

    ```
    {{ Toast::info( 'Saved', 'Item saved')->run() }}

    ```

    #### Toast Types

    [](#toast-types)

    > info('heading', 'message text')

    ```
    First parameter shows title of the Toast
    Second parameter shows message to be display
    {{ Toast::info('Info', 'Info Toast')->run() }}

    ```

    > warning('heading', 'message text')

    ```
    First parameter shows title of the Toast
    Second parameter shows message to be display
    {{ Toast::info('Warning', 'Warning Toast')->run() }}

    ```

    > error('heading', 'message text')

    ```
    First parameter shows title of the Toast
    Second parameter shows message to be display
    {{ Toast::info('Error', 'Error Toast')->run() }}

    ```

    > success('heading', 'message text')

    ```
    First parameter shows title of the Toast
    Second parameter shows message to be display
    {{ Toast::info('Success', 'Success Toast')->run() }}

    ```

    #### Animation

    [](#animation)

    > fade() for fade transitions

    ```
      {{ Toast::info('Success', 'Success Toast')->fade()->run() }}

    ```

    > slide() for slide up and down transitions

    ```
      {{ Toast::info('Success', 'Success Toast')->slide()->run() }}

    ```

    > plain() simple show from and hide to corner transition

    ```
      {{ Toast::info('Success', 'Success Toast')->plain()->run() }}

    ```

    #### Other Handy Functions

    [](#other-handy-functions)

    > showCloseButton(true) Pass boolean (`true` or `false`) to show or hide cross button on toast, by default it is true

    ```
      {{ Toast::info('Success', 'Success Toast')->showCloseButton()->run() }}

    ```

    > hideAfter(3000) Specify the duration, for how long toast will be visile or pass `false` to make it sticky

    ```
    **Hide after 3 seconds**
      {{ Toast::info('Duration', 'This toast will be disappear after 3 seconds')->hideAfter(3000)->run() }}

    **Sticky**
      {{ Toast::info('Duration', 'This toast is a sticky toast.')->hideAfter(false)->run() }}

    ```

    > noOfToastToShow(1) how many toasts can be displayed in stack

    ```
      {{ Toast::info('Success', 'Success Toast')->noOfToastToShow(3)->run() }}

    ```

    > position() where toast will be displyed

    ```
      position can be one of these
      ['bottom-left', 'bottom-right', 'top-right', 'top-left', 'bottom-center', 'top-center', 'mid-center']
      {{ Toast::info('Toast Position', 'Toast is displayed in the center position.')->position('top-center')->run() }}

      or simple object
      { top: - , bottom: -, left: -, right: - }
      {{ Toast::info('Toast Position', 'Toast is positioned using object.')->position("{ top: '12' , bottom: '12', left: '12', right: '12' }")->run() }}

    ```

    > textAlign() define text alignment e.g. left, right, center

    ```
      {{ Toast::info('Text Alignment', 'Text has left alignment.')->textAlign('left')->run() }}

    ```

    > loader('#9EC600' ) show loader with color value

    ```
      {{ Toast::info('Text Alignment', 'Text has left alignment.')->loader('#9EC600')->run() }}
    color value can be Hexa value or Html color name

    ```

#### Thanks

[](#thanks)

Special thanks to [Kamran Ahmed](https://github.com/kamranahmedse/)

How to Contribute
-----------------

[](#how-to-contribute)

- Feel free to add some new functionality, improve some existing functionality etc and open up a pull request explaining what you did.
- Report any issues in the [issues section](https://github.com/faisalahsan/lara-alerts/issues)
- Also you can reach me directly at  with any feedback

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

3

Last Release

3688d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/294d9f2122863588745c3c468e7b25c595c7a8e7729913007ceed7114a54b2c9?d=identicon)[faisalahsanse](/maintainers/faisalahsanse)

---

Top Contributors

[![faisalahsan](https://avatars.githubusercontent.com/u/8427383?v=4)](https://github.com/faisalahsan "faisalahsan (1 commits)")

---

Tags

laravelalertstoastsalertsutillaraalerts

### Embed Badge

![Health badge](/badges/faisalahsan-laraalerts/health.svg)

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

###  Alternatives

[prologue/alerts

Prologue Alerts is a package that handles global site messages.

3486.1M30](/packages/prologue-alerts)[arcanedev/notify

Flexible flash notifications helper for Laravel.

139.5k1](/packages/arcanedev-notify)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

252.7k](/packages/cornford-bootstrapper)

PHPackages © 2026

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