-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAlert.php
More file actions
44 lines (36 loc) · 1.16 KB
/
Alert.php
File metadata and controls
44 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace App\Livewire\Traits;
use TallStackUi\Foundation\Interactions\Dialog;
use TallStackUi\Traits\Interactions;
trait Alert
{
use Interactions;
public function success(string $title = 'Done!', string $description = 'Task completed successfully.'): void
{
$this->dialog()
->success(__($title), __($description))
->send();
}
public function error(string $title = 'Ooops!', string $description = 'Something went wrong!'): void
{
$this->dialog()
->error(__($title), __($description))
->send();
}
public function warning(string $title = 'Ooops!', string $description = null): void
{
$this->dialog()
->warning(__($title), __($description))
->send();
}
public function info(string $title = 'Warning!', string $description = null): void
{
$this->dialog()
->info(__($title), __($description))
->send();
}
public function question(string $title = 'Warning!', string $description = 'Are you sure?'): Dialog
{
return $this->dialog()->question(__($title), __($description));
}
}