PHPackages                             othyn/laravel-toastie - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. othyn/laravel-toastie

AbandonedArchivedLibrary[Mail &amp; Notifications](/categories/mail)

othyn/laravel-toastie
=====================

Simple Toastie notifications with built in defaults for ALT stack (Alpine, Laravel, Tailwind) applications

v1.0.0(3y ago)1121[1 issues](https://github.com/othyn/laravel-toastie/issues)MITPHPPHP ^8.1

Since Aug 13Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

 [![logo](art/logo.svg)](art/logo.svg)Laravel Toastie
===============

[](#laravel-toastie)

Simple Toast notifications with built in default designs for ALT stack (Alpine, Laravel, Tailwind) applications with easy options to customise to your hearts content.

 [ ![tests](https://github.com/othyn/laravel-toastie/actions/workflows/tests.yml/badge.svg) ](https://github.com/othyn/laravel-toastie/actions/workflows/tests.yml) [ ![stan](https://github.com/othyn/laravel-toastie/actions/workflows/stan.yml/badge.svg) ](https://github.com/othyn/laravel-toastie/actions/workflows/stan.yml) [ ![lint](https://github.com/othyn/laravel-toastie/actions/workflows/lint.yml/badge.svg) ](https://github.com/othyn/laravel-toastie/actions/workflows/lint.yml) [ ![coverage](https://camo.githubusercontent.com/89f45d49f11b0a1e547cba3f1ec12c72f7299c19a45df6d877ffbdc68aef7b0f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5465737420436f7665726167652d3130302532352d677265656e) ](https://github.com/othyn/laravel-toastie/actions/workflows/tests.yml) [ ![downloads](https://camo.githubusercontent.com/22006cca4bd496589551a455ec6354e6a546ce4e632ce80890347532ce50e1d5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f7468796e2f6c61726176656c2d746f61737469653f636f6c6f723d677265656e) ](#floppy_disk-install) [ ![contributors](https://camo.githubusercontent.com/692e40bed075af7fc30824c57ea98ad72bfb47ca7b63d814de4e2afd24230562/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6f7468796e2f6c61726176656c2d746f6173746965) ](https://github.com/othyn/laravel-toastie/graphs/contributors) [ ![forks](https://camo.githubusercontent.com/15b195ccd8d5b507dca2c63056aee2720075e509a5356ee4811f28b8d4df4654/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6f7468796e2f6c61726176656c2d746f6173746965) ](https://github.com/othyn/laravel-toastie/network/members) [ ![stars](https://camo.githubusercontent.com/ddf09e1c63986036e1b222c52d2da9334a5e8c046aa73ae5d6ec37ad87184612/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f7468796e2f6c61726176656c2d746f6173746965) ](https://github.com/othyn/laravel-toastie/stargazers) [ ![open issues](https://camo.githubusercontent.com/1ae3dcbf36073cf4e3861652e1271380ce60e46b1bf27ac35231fe4aae2d3454/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6f7468796e2f6c61726176656c2d746f6173746965) ](https://github.com/othyn/laravel-toastie/issues/) [ ![license](https://camo.githubusercontent.com/156ad88acea252e6e701552b4c3d2df959f500293c27e8693c800f73e78e826c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6f7468796e2f6c61726176656c2d746f6173746965) ](https://github.com/othyn/laravel-toastie/blob/master/LICENSE)

####  [Install Latest Version](#floppy_disk-install)  ·  [Report Bug](https://github.com/othyn/laravel-toastie/issues)  ·  [Request Feature](https://github.com/othyn/laravel-toastie/issues)

[](#--------install-latest-version------------------report-bug------------------request-feature----)

📔 Table of Contents
-------------------

[](#notebook_with_decorative_cover-table-of-contents)

- [About the Project](#star2-about-the-project)
    - [Screenshots](#camera-screenshots)
    - [Tech Stack](#space_invader-tech-stack)
    - [Features](#dart-features)
- [Install](#floppy_disk-install)
    - [Version Matrix](#version-matrix)
- [Usage](#hammer_and_wrench-usage)
    - [Configuration](#wrench-configuration)
    - [PHP API](#elephant-php-api)
    - [Blade Components](#page_facing_up-blade-components)
- [Contributing](#bread-contributing)
    - [Project Tooling Quick Reference](#toolbox-project-tooling-quick-reference)
- [Changelog](https://github.com/othyn/laravel-toastie/releases)
- [License](#warning-license)
- [Acknowledgements](#gem-acknowledgements)

🌟 About the Project
-------------------

[](#star2-about-the-project)

All the other Laravel Toast notification libraries out there seemed to have nailed the API for creating Toasts, but the key areas they were lacking in are keeping up to date and ✨ style ✨.

This package aims to solve that by providing a default set of Toasts that look good and are easy to use, with it being very easy to change up the design if you hate the look of them and roll your own!

Toastie has support for 4 key toast types/states; Success, Info, Warning and Error.

### 📷 Screenshots

[](#camera-screenshots)

 [![screenshot of success toast](art/screenshot_success.png)](art/screenshot_success.png) [![screenshot of info toast](art/screenshot_info.png)](art/screenshot_info.png)

 [![screenshot of warning toast](art/screenshot_warning.png)](art/screenshot_warning.png) [![screenshot of error toast](art/screenshot_error.png)](art/screenshot_error.png)

### 👾 Tech Stack

[](#space_invader-tech-stack)

- Language: [PHP](https://www.php.net/)
- Dependency Manager: [Composer](https://getcomposer.org/)
- Containerisation: [Docker](https://www.docker.com/)
- Build Tool: [Make](https://www.gnu.org/software/make/manual/html_node/Simple-Makefile.html)
- Framework: [Laravel](https://laravel.com/)
- Framework: [Alpine](https://alpinejs.dev/)
- Framework: [Tailwind](https://tailwindcss.com/)
- Package: [illuminate/support](https://github.com/illuminate/support)
- Package: [orchestra/testbench](https://github.com/orchestra/testbench)
- Package: [pestphp/pest](https://github.com/pestphp/pest)
- Package: [laravel/pint](https://github.com/laravel/pint)
- Package: [phpstan/phpstan](https://github.com/phpstan/phpstan)

### 🎯 Features

[](#dart-features)

- Simple to use
- Laravelified
- Alpine &amp; Tailwind
- Expressive API
- Auto hide or only on dismiss
- ✨ Stylish ✨ and modern default design
- Highly customisable
- Cheeky

💾 Install
---------

[](#floppy_disk-install)

Installation can be done via [Composer](https://getcomposer.org/):

```
composer require othyn/laravel-toastie
```

After installation you will need to do a fresh build of any assets via your frontend build tool of choice, which is probably [Vite](https://vitejs.dev/). This is so that the Tailwind bundler can pickup the new views and load in the classes the package uses (if they haven't already been bundled via usage elsewhere in your application) into your app bundles. You may also need to restart any Docker containers if you are still having issues.

Next you are going to want to head down to the [configuration](#wrench-configuration), so lets get started on [usage](#hammer_and_wrench-usage)! See you there.

### Version Matrix

[](#version-matrix)

Here is the current version matrix for project supported versions of used frameworks and libraries.

Toastie VersionPHP VersionLaravel VersionAlpine VersionTailwind Verison`1.0.0``^8.1``^9.24``^3.4.2``^3.1.0`If you require support for an older version of Laravel, submit an issue as we may be able to look into dropping the version requirements down, as I don't think it needs to be this new. Or, feel free to submit a PR!

🛠️ Usage
--------

[](#hammer_and_wrench-usage)

There are three key parts to Toastie;

1. The configuration.
    - Where you can customise Toastie's behaviour.
2. The PHP API.
    - How you can call and action Toastie.
3. The Blade components.
    - How you can render Toastie.

Let's kick things off with the configuration, I'll meet you down there.

### 🔧 Configuration

[](#wrench-configuration)

Hello again! First thing we're going to need to do is publish the configuration so we can set things up how we want them.

We do this my telling Laravel to publish the config file into our working directory, instead of relying on the default one bundled with this package:

```
php artisan vendor:publish \
    --provider="Othyn\\Toastie\\Providers\\ToastieServiceProvider" \
    --tag="toastie-config"
```

You should now have an `config/toastie.php` file within your project that you can edit. If you go ahead and open it up, you'll see something like:

```
