1. Go to this page and download the library: Download mattlibera/livewire-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/ */
mattlibera / livewire-flash example snippets
public function store()
{
flash('Success!');
return redirect()->back();
}
public function livewireAction()
{
flash('Your request was successful!')->success()->livewire($this);
}
'styles' => [
'info' => [
'bg-color' => 'bg-blue-100', // could change to bg-purple-100, or something.
'border-color' => 'border-blue-400',
'icon-color' => 'text-blue-400',
'text-color' => 'text-blue-800',
'icon' => 'fas fa-info-circle', // could change to another FontAwesome icon
],
// livewire component
flash('Message 1'); // this one will get lost.
flash('Message 2')->livewire($this); // this one will show on current page via Livewire