1. Go to this page and download the library: Download theorythree/laratoaster 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/ */
// controller example
namespace App\Http\Controllers;
use Toaster; // (1)
{
// ...
public function store(Request $request)
{
// your store() method code
// (2) Call Toaster
Toaster::success("Your item was saved.");
return redirect()->route('items.show',$item->id);
}
}
/*
Somewhere in your code probably a
store(), update(), or destroy() method.
*/
Toaster::success("Success feels good!");
Toaster::warning("I got bad feeling about this.");
Toaster::danger("I imagined that working out differently.");
/*
You can also use any of the other named functions
that correspond with the Bulma status class names.
*/
Toaster::white("I don't see the world in black and white.");
Toaster::black("Who turned out the lights?");
Toaster::light("I probably should be used on a dark background.");
Toaster::dark("I probably should be used on a light background.");
Toaster::info("I'm cool either way.");