2017 © Pedro Peláez
 

library flash

A simple php and laravel flash alert package.

image

orus/flash

A simple php and laravel flash alert package.

  • Tuesday, July 18, 2017
  • by orus
  • Repository
  • 1 Watchers
  • 0 Stars
  • 22 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 10 % Grown

The README.md

A simple php and laravel flash alert package

this package gives you a simple way to manage alerts into your laravel project. It also works with any php project., (*1)

Installation

Include the package in your project using composer., (*2)

composer require orus/flash

If you're using a version of laravel prior to 5.5 you need you to include te service provider and the alias in your config/app.php., (*3)

"providers"  =>  [
  ...
  Orus\Flash\Providers\FlashServiceProvider::class,
],

"aliases"  =>  [
  ...
  "Flash"  =>  Orus\Flash\Facades\Flash::class
]

Usage

Before performing your redirect, you can call the flash() helper function., (*4)

Route::post("/login", function() {
  flash("welcome in the matrix");

  return redirect("/profile");
}

You can specify the alert type by using the fluent api it offers., (*5)

flash(); // Flash object.
flash()->default("message") // A default flash alert
flash()->danger("message") // A danger flash alert
flash()->warning("message") // A warning flash alert
flash()->info("message") // An info flash alert
flash()->success("message") // A success flash alert
flash()->default("message")->title("Default") // Set the alert title
flash()->danger("message")->important() // Set the alert as important
flash()->info("message")->options(["key"] => "value") // Add options to the alert
flash("message")->success(); // Or define your message and set the type.
flash()->info("message")->success("message"); // You can chain multiple alerts.


It also gives you the ability to set multiple flash alerts., (*6)

Route::post("/login", function() {
  flash("welcome in the matrix")->default();
  flash("May the code be with you!")->info();

  return redirect("/profile");
}

Then you can get a collection of the alerts in your views., (*7)

{{ flash()->all() }}

The Versions

18/07 2017

dev-master

9999999-dev

A simple php and laravel flash alert package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Youssouf CHERIF

laravel php alert notifications flash

17/07 2017

1.1

1.1.0.0

A simple php and laravel flash alert package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Youssouf CHERIF

laravel php alert notifications flash

17/07 2017

1.0

1.0.0.0

A simple php and laravel flash alert package.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Youssouf CHERIF

laravel php alert notifications flash