PHPackages                             rezaulhreza/flash-toast - 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. rezaulhreza/flash-toast

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

rezaulhreza/flash-toast
=======================

A fluent toast manager built with TALL stack.

1.0.3(3y ago)232[4 PRs](https://github.com/rezaulhreza/flash-toast/pulls)MITPHPPHP ^7.4|^8.1

Since Nov 25Pushed 2y agoCompare

[ Source](https://github.com/rezaulhreza/flash-toast)[ Packagist](https://packagist.org/packages/rezaulhreza/flash-toast)[ Docs](https://github.com/rezaulhreza/flash-toast)[ RSS](/packages/rezaulhreza-flash-toast/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (15)Versions (9)Used By (0)

Flash Toast- Toast library with Livewire and Alpine
===================================================

[](#flash-toast--toast-library-with-livewire-and-alpine)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8fca8991463ed36e3765ca2c6e9d6437af09e36278ece38a9dc2779d92f71b37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72657a61756c6872657a612f666c6173682d746f6173742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezaulhreza/flash-toast)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c24db5c5098f24e2e158592755a2deae5fc9aa6bf41816d4b44218e03cb7928b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f72657a61756c6872657a612f666c6173682d746f6173742f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/rezaulhreza/flash-toast/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6d275702f2ba1db5c4568cf887a8760742d815c0e8c79e962eb6f18be910ce71/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f72657a61756c6872657a612f666c6173682d746f6173742f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/rezaulhreza/flash-toast/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/06ed6675990b608fa02e5070e7873d5d49b04882b19b31d8821e640dfdfa4760/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72657a61756c6872657a612f666c6173682d746f6173742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rezaulhreza/flash-toast)

Demo Project
------------

[](#demo-project)

**[FlashToast Demo](https://github.com/rezaulhreza/flash-toast-demo)**

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

[](#installation)

You can install the package via composer:

```
composer require rezaulhreza/flash-toast
```

then publish the config file

```
php artisan vendor:publish --tag="flash-toast-config"
```

publish the view files

```
php artisan vendor:publish --tag="flash-toast-views"
```

Once you publish the file, move the files from `resources\views\vendor\flash-toast\components`to `resources\views\components`. now you can place the file anywhere you want such as .

alterantively, just do:

```
@include('vendor.flash-toast.components.flash-toast')
```

Usage
-----

[](#usage)

Runs with the TALL stack: Laravel, TailwindCSS, Livewire, AlpineJS.

Guide:

Available methods: success- info - warning - danger. title, html, level, duration.

use `FlashToast` in the component class.

In the component class: Example:

```
$this->toastInfo('this is a info toast');
$this->toastSuccess('this is a successful toast');
```

Of course the above are customisable.

To add a html code or title or duration even custom level(level is the type of toast e.g. - success, info etc). Example:

```
use FlashToast; // don't forget to import it!!!
$this->toastSuccess('This is a string message');
```

p.s: to showcase the usage in the readme, a space was left intentionally otherwise it would compile the markdown preview with h1. Use actual markup when using within the applciation scenario.

Blade component:

```
component/toast.blade.php
```

Styles are inside a blade file, however, you can customize it

An example is given below

```
