PHP code example of tonystore / livewire-notification

1. Go to this page and download the library: Download tonystore/livewire-notification 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/ */

    

tonystore / livewire-notification example snippets


<head>
    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/iziToast.min.css" rel="stylesheet" type="text/css" />

</head>
 <body> 
    ...
    @livewireScripts
    ...
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/iziToast.min.js">
    </script>
    ...

    //INSERT COMPONENT

       <x-livewire-notification::toast />

    //OR

    @component('livewire-notification::components.toast') @endcomponent
 </body> 

//config/livewire-notification

return [
    'toast' => [
        'title' => '', //Defaut Title
        'position' => 'topRight', //Defaut Position
        'timeout' => 3000, //Display Time
        'modal' => null, //Very important, it defines if an event is triggered to close a Bootstrap modal.
    ],


$this->alert(
        'success',
        'Example of notification.',
        );
        

$this->alert('info','Example of notification with modal event', [
        'modal' => '#hideModal'
    ]
);

sh
php artisan vendor:publish --provider="Tonystore\LivewireNotification\LivewireNotificationProvider" --tag="config"