mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-06-16 09:27:29 +08:00
send staff message to telegram
This commit is contained in:
@@ -2,8 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Repositories\ToolRepository;
|
||||
use Google\Service\Testing\ToolResultsExecution;
|
||||
use App\Enums\ModelEventEnum;
|
||||
|
||||
class StaffMessage extends NexusModel
|
||||
{
|
||||
@@ -27,4 +26,16 @@ class StaffMessage extends NexusModel
|
||||
return $this->belongsTo(User::class, 'answeredby');
|
||||
}
|
||||
|
||||
public static function add(int $sender, string $subject, string $msg)
|
||||
{
|
||||
$record = self::query()->create([
|
||||
'sender' => $sender,
|
||||
'subject' => $subject,
|
||||
'msg' => $msg,
|
||||
'added' => now(),
|
||||
]);
|
||||
fire_event(ModelEventEnum::STAFF_MESSAGE_CREATED, $record);
|
||||
return $record;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user