46 lines
618 B
PHP
46 lines
618 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Traits;
|
|
|
|
trait Alert
|
|
{
|
|
/**
|
|
* Add an info alert
|
|
*/
|
|
public function info($message)
|
|
{
|
|
$this->alert('info', $message);
|
|
}
|
|
|
|
/**
|
|
* Add an success alert
|
|
*/
|
|
public function success($message)
|
|
{
|
|
$this->alert('success', $message);
|
|
}
|
|
|
|
/**
|
|
* Add an warning alert
|
|
*/
|
|
public function warning($message)
|
|
{
|
|
$this->alert('warning', $message);
|
|
}
|
|
|
|
/**
|
|
* Add an danger alert
|
|
*/
|
|
public function danger($message)
|
|
{
|
|
$this->alert('danger', $message);
|
|
}
|
|
|
|
/**
|
|
* Add an alert
|
|
*/
|
|
public function alert($type, $message)
|
|
{
|
|
$this->emit('alert', $type, $message);
|
|
}
|
|
}
|