52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class PushSubscription extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'event_id',
|
|
'guest_identifier',
|
|
'device_id',
|
|
'endpoint',
|
|
'endpoint_hash',
|
|
'public_key',
|
|
'auth_token',
|
|
'content_encoding',
|
|
'status',
|
|
'expires_at',
|
|
'last_seen_at',
|
|
'last_notified_at',
|
|
'last_failed_at',
|
|
'failure_count',
|
|
'language',
|
|
'user_agent',
|
|
'meta',
|
|
];
|
|
|
|
protected $casts = [
|
|
'expires_at' => 'datetime',
|
|
'last_seen_at' => 'datetime',
|
|
'last_notified_at' => 'datetime',
|
|
'last_failed_at' => 'datetime',
|
|
'meta' => 'array',
|
|
];
|
|
|
|
public function event(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Event::class);
|
|
}
|
|
|
|
public function tenant(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Tenant::class);
|
|
}
|
|
}
|