All Projects → squareboat → flash

squareboat / flash

Licence: MIT license
An easy way for Laravel flash notifications.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to flash

Pagination
🎁 Laravel 5 Custom Pagination Presenter
Stars: ✭ 119 (+750%)
Mutual labels:  laravel-package, laravel-5-package
Blogetc
Easily add a full Laravel blog (with built in admin panel and public views) to your laravel project with this simple package.
Stars: ✭ 198 (+1314.29%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Auto Translate
Automatically translate your language files using a translator service
Stars: ✭ 153 (+992.86%)
Mutual labels:  laravel-package, laravel-5-package
Larabug
Laravel error reporting tool
Stars: ✭ 84 (+500%)
Mutual labels:  laravel-package, laravel-5-package
Sneaker
An easy way to send emails whenever an exception occurs on server.
Stars: ✭ 223 (+1492.86%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Excel
🚀 Supercharged Excel exports and imports in Laravel
Stars: ✭ 10,417 (+74307.14%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Page Speed
Package to optimize your site automatically which results in a 35%+ optimization
Stars: ✭ 2,097 (+14878.57%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Api Health
Monitor first and third-party services and get notified when something goes wrong!
Stars: ✭ 65 (+364.29%)
Mutual labels:  laravel-package, laravel-5-package
Hooks
Hooks is a extension system for your Laravel application.
Stars: ✭ 202 (+1342.86%)
Mutual labels:  laravel-package, laravel-5-package
Voyager Frontend
The Missing Front-end for The Missing Laravel Admin 🔥
Stars: ✭ 200 (+1328.57%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Pdf
A Simple package for easily generating PDF documents from HTML. This package is specially for laravel but you can use this without laravel.
Stars: ✭ 79 (+464.29%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Gitscrum
GitScrum is a Project Management Tool, developed to help entrepreneurs, freelancers, managers, and teams Skyrocket their Productivity with the Agile methodology and Gamification.
Stars: ✭ 2,686 (+19085.71%)
Mutual labels:  laravel-package, laravel-5-package
Laraupdater
Enable Laravel App Self-Update. Allow your Laravel Application to auto-update itself.
Stars: ✭ 75 (+435.71%)
Mutual labels:  laravel-package, laravel-5-package
Eye
Eyewitness.io package for Laravel 5 applications
Stars: ✭ 114 (+714.29%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Remember Uploads
Laravel Middleware and helper for remembering file uploads during validation redirects
Stars: ✭ 67 (+378.57%)
Mutual labels:  laravel-package, laravel-5-package
Telegram Bot Sdk
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
Stars: ✭ 2,212 (+15700%)
Mutual labels:  laravel-package, laravel-5-package
Indipay
The Laravel Framework Package for Indian Payment Gateways. Currently Supported Gateway: CCAvenue, PayUMoney, EBS, CitrusPay ,ZapakPay (Mobikwik), Paytm, InstaMojo , Mocker
Stars: ✭ 50 (+257.14%)
Mutual labels:  laravel-package, laravel-5-package
Laravel Email Verification
Laravel package to handle user verification using an activation mail
Stars: ✭ 63 (+350%)
Mutual labels:  laravel-package, laravel-5-package
Voyager Hooks
Hooks system integrated into Voyager.
Stars: ✭ 200 (+1328.57%)
Mutual labels:  laravel-package, laravel-5-package
Auth Tests
Always-current tests for Laravel's authentication system. Curated by the community.
Stars: ✭ 230 (+1542.86%)
Mutual labels:  laravel-package, laravel-5-package

Laravel Flash Notifications

Build Status

Laravel 5 flash messages, originally developed after the Laracasts video tutorial on the same topic: Flexible Flash Messages.

Install

Install via composer

$ composer require squareboat/flash

Configure Laravel

Once installation operation is complete, simply add both the service provider and facade classes to your project's config/app.php file:

Service Provider

SquareBoat\Flash\FlashServiceProvider::class,

Facade

'Flash' => SquareBoat\Flash\Facades\Flash::class,

Include default alert view to your layout

Package default provides bootstrap ready alert view. Just include flash::message file to your main layout in blade:

@include('flash::message')

or if you don't use blade:

<?= view('flash::message') ?>

If you need to modify the flash message partials, you can run:

php artisan vendor:publish

The package view will now be located in the resources/views/vendor/flash directory.

And that's it! With your coffee in reach, start flashing out messages!

Usage

Within your controllers, before you perform a redirect...

public function create()
{
    // do something awesome...

    flash()->success('Resource created successfully!');

    return redirect()->route('dashboard');
}

Level for all alerts are following:

Success

Flash::success('This is a success message.');

or

flash()->success('This is a success message.');

Info

Flash::info('This is an info message.');

or

flash()->info('This is an info message.');

Warning

Flash::warning('This is a warning message.');

or

flash()->warning('This is a warning message.');

Error

Flash::error('This is an error message.');

or

flash()->error('This is an error message.');

Important

Flash::info('This is an important message.')->important();

or

flash('This is an important message.')->important();

Hiding Flash Messages

A common desire is to display a flash message for a few seconds, and then hide it. To handle this, write a simple bit of JavaScript. For example, using jQuery, you might add the following snippet just before the closing tag.

<script>
  $('div.alert').not('.alert-important').delay(3000).fadeOut(350);
</script>

This will find any alerts - excluding the important ones, which should remain until manually closed by the user - wait three seconds, and then fade them out.

License

The MIT License. Please see License File for more information. Copyright © 2016 SquareBoat

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].