New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

tonning/flash

Flash for Laravel
16,814 1
Install
composer require tonning/flash
Latest Version:1.0.0
PHP:^8.0
Laravel:10 – 13
Older releases:8 · 9
License:MIT
Last Updated:Dec 29, 2024
Links: GitHub  ·  Packagist
Maintainer: tonning

Flash for Laravel

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This composer package offers a Tailwind optimized flash messaging setup for your Laravel applications.

Installation

You can install the package via composer:

composer require tonning/flash

You can publish the view files with:

php artisan vendor:publish --provider="Tonning\Flash\FlashServiceProvider" --tag="flash-views"

You can publish the config file with:

php artisan vendor:publish --provider="Tonning\Flash\FlashServiceProvider" --tag="flash-config"

This is the contents of the published config file:

return [
    'display_errors' => true,
];

Usage

Anywhere in your application you can added a flash notification.

use Tonning\Flash\Flash;

Flash::info('A new software update is available. See what’s new in version 2.0.4.');
flash_info

Displaying notifications

@if(flash()->hasAny())
    {!! flash() !!}
@endif

Titles

You can also provide a title to your notifications that will be displayed along with it.

use Tonning\Flash\Flash;

Flash::warning('Please confirm your email address.', 'Attention needed');
flash_warning_single

Grouping

Notifications of the same type will be grouped in an unordered list.

use Tonning\Flash\Flash;

Flash::warning('Facilisis himenaeos nullam habitasse lacus sem auctor.');
Flash::warning('Please confirm your email address.', 'Attention needed');
Flash::warning('Facilisis egestas fermentum porttitor sapien eleifend amet.');
flash_warning_multiple_grouped

Errors

This package will by default also display any validation errors.

throw ValidationException::withMessages(['Something went wrong.']);
flash_error

This can be turned of in the config file.

'display_errors' => false,

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Related Packages

tonning/console-print-log

A Laravel package to print log messages if run in the console.

6,540 0
tonning/commits

A Laravel package to get latest git commit messages.

8 0
caffeinated/flash

Flash Messages for Laravel

51,183 43
combindma/flash

Easy Flash Messages for a Laravel App

1,194 0
smodav/flash

Flash messaging package for use with laravel

262 3

Version History

Version Released PHP Laravel License
1.0.0 ^8.0 MIT
0.1.5 ^8.0 ^8.37 || ^9.0|^10.0 MIT
0.1.4 ^8.0 ^8.37 || ^9.0 MIT
0.1.3 ^8.0 ^8.37 MIT
0.1.2 ^8.0 ^8.37 MIT