-
Notifications
You must be signed in to change notification settings - Fork 2
IziToast
Viames Marino edited this page Mar 31, 2026
·
2 revisions
Pair\Html\IziToast builds JavaScript code for iziToast notifications.
new IziToast(string $title, string $message, ?string $type = 'info')Valid types: info, success, warning, error, question, progress.
balloon(bool $flag)class(string $class)close(bool $flag)closeOnEscape(bool $flag)displayMode(int $mode)icon(string $icon)id(string $id)image(string $image)position(string $position)progressBar(bool $flag)theme(string $theme)timeout(int|bool $timeout)overlay(bool $flag)render(): string
$toast = (new \Pair\Html\IziToast('Saved', 'User updated', 'success'))
->position('topRight')
->timeout(3000)
->progressBar(true);
echo $toast->render();In controllers, use app helpers:
$this->toast('Saved', 'User updated', 'success');Pair can switch the toast driver globally through:
$app->setToastDriver('izitoast');When no position is provided, IziToast uses the native iziToast default position.
Supported aliases are izitoast, sweetalert, sweetalert2 and swal.
See also: AppTrait, SweetAlert, SweetToast, Application.