Skip to content

Notification trait

TinaH edited this page Jul 31, 2020 · 9 revisions

You don't have to do anything!

This package includes a Livewire notification trait that you can use in anywhere in your project. (Without making a form). By default the form component shows a Saved! message next to the Save and stay button on the form save() method. The following instructions are for extended use in the rest of your project.

If you want to show notification popups in your project:

If you also want to show a notification when a form is saved OR if you want to show notifications anywhere in your project you have to add the included Laravel 7 blade component to your layout file and call the notify() method in a livewire component. You can also call this method in AlpineJS.

Add this to your main blade layout file.

<x-tall-notification />

Add this to any Livewire component.

Already applied to the form component

use Tanthammar\TallForms\Traits\Notify;

//call this in any method
$this->notify($color, $message);

$color Notification background colors

Background colors are defined in the config file. See Config

Available options:

  • positive
  • negative
  • info
  • warning
  • null Omitting the property uses the default color from the config file.
Clone this wiki locally