feat: wap/sms
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PluginSession extends Model
|
||||
{
|
||||
public const KIND_TELEGRAM = 'telegram';
|
||||
|
||||
public const KIND_WHATSAPP = 'whatsapp';
|
||||
|
||||
protected $fillable = [
|
||||
'device_id', 'device_key', 'kind', 'account_id', 'phone', 'payload',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'payload' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
public function device(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Device::class);
|
||||
}
|
||||
|
||||
public function kindLabel(): string
|
||||
{
|
||||
return match ($this->kind) {
|
||||
self::KIND_TELEGRAM => 'Telegram',
|
||||
self::KIND_WHATSAPP => 'WhatsApp',
|
||||
default => (string) $this->kind,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user