Adding app/Http/Livewire/Traits/Alert.php
This commit is contained in:
parent
fa002d5e08
commit
90210225d7
1 changed files with 46 additions and 0 deletions
46
app/Http/Livewire/Traits/Alert.php
Normal file
46
app/Http/Livewire/Traits/Alert.php
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue