PHP code example of orus / flash

1. Go to this page and download the library: Download orus/flash library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

orus / flash example snippets


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

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.



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

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