1. Go to this page and download the library: Download fungku/sweet-flasher 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/ */
use Fungku\SweetFlasher\FlashMessage;
class MyController extends Controller
{
public function store(FlashMessage $flashMessage)
{
// save ...
$flashMessage->success("Nicely done");
return response();
}
}
// Default info message
flash("This is a default info message");
// Other usages like:
// flash->{$level}($message, $title, $confirm_button_text)
flash()->success("This is a success message");
flash()->error("Some error!");
flash()->warning("Some Warning!", "Uh oh!");
use Fungku\SweetFlasher\FlashMessage;
class MyController
{
private $flash;
public function __construct(FlashMessage $flash)
{
$this->flash = $flash;
}
public function doAction()
{
// .. do action
$this->flash->success('You did it!');
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.