PHP code example of rezaulhreza / flash-toast

1. Go to this page and download the library: Download rezaulhreza/flash-toast 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/ */

    

rezaulhreza / flash-toast example snippets


@

$this->toastInfo('this is a info toast');
$this->toastSuccess('this is a successful toast');

use FlashToast; // don't forget to import it!!!
 $this->toastSuccess('This is a string message');
 


namespace Rezaulhreza\FlashToast\Example;

use Livewire\Component;
use Rezaulhreza\FlashToast\FlashToast;

class FlashToastExample extends Component
{

    public function stringMessage()
    {
        $this->toastSuccess('This is a string message');
    }

    public function text()
    {
        $this->flashToast((new \Rezaulhreza\FlashToast\Manager\ToastManager)->text('Some text'));
    }

    public function html()
    {
        $this->flashToast((new \Rezaulhreza\FlashToast\Manager\ToastManager)->title('My title')->level('warning')->html('<h2 class="text-2xl">Sub title</h2> <b>Warning</b>'));
    }

    public function duration()
    {
        $this->flashToast((new \Rezaulhreza\FlashToast\Manager\ToastManager)->text('Showing for 200 ms')->showForMilliseconds(200));
    }

    public function render()
    {
        return view('flash-toast-example');
    }
}
bash
php artisan vendor:publish --tag="flash-toast-config"
bash
php artisan vendor:publish --tag="flash-toast-views"
bash
component/toast.blade.php