feat: add app and database modules

This commit is contained in:
2026-05-21 16:05:11 +07:00
parent 37b7e783f5
commit fad70d096b
212 changed files with 23901 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class SystemNotification implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
public $type;
public $title;
public $data;
/**
* Create a new event instance.
*
* @param string $type (success, error, warning, info)
*/
public function __construct(string $message, string $type = 'info', ?string $title = null)
{
$this->message = $message;
$this->type = $type;
$this->title = $title ?? 'System Notification';
$this->data = [
'message' => $this->message,
'type' => $this->type,
'title' => $this->title,
];
}
/**
* Get the channels the event should broadcast on.
*
* @return array<int, Channel>
*/
public function broadcastOn(): array
{
return [
new Channel('system-notifications'),
];
}
/**
* The event's broadcast name.
*/
public function broadcastAs(): string
{
return 'message.sent';
}
}