1. Go to this page and download the library: Download kapouet/laravel-notyf 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/ */
kapouet / laravel-notyf example snippets
Notyf::success('I\'m a success message');
Notyf::error('I\'m an error message');
// If you are added custom types in config file
// https://github.com/caroso1222/notyf#inotyfnotificationoptions
Notyf::message('custom', 'I\'m a custom message');
use Kapouet\Notyf\Traits\Livewire\WithNotyf;
use Livewire\Component;
class MyComponent extends Component
{
use WithNotyf;
public function render(): string
{
return <<<'blade'
<div>
<button wire:click="toast">Toast me</button>
</div>
blade;
}
public function toast(): void
{
$this->notyfSuccess('I\'m a success message');
$this->notyfError('I\'m an error message');
// If you are added custom types in config file
// https://github.com/caroso1222/notyf#inotyfnotificationoptions
$this->notyfMessage('custom', 'I\'m a custom message');
}
}