You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
489 B
26 lines
489 B
<?php
|
|
|
|
namespace App\Livewire\Concerns;
|
|
|
|
use Livewire\Component;
|
|
|
|
/**
|
|
* @mixin Component
|
|
*/
|
|
trait WithToast
|
|
{
|
|
public function success(string $message): void
|
|
{
|
|
$this->js("window.toast(\"$message\", \"success\")");
|
|
}
|
|
|
|
public function warning(string $message): void
|
|
{
|
|
$this->js("window.toast(\"$message\", \"warning\")");
|
|
}
|
|
|
|
public function error(string $message): void
|
|
{
|
|
$this->js("window.toast(\"$message\", \"warning\")");
|
|
}
|
|
}
|
|
|