Add guest push notifications and queue alerts
This commit is contained in:
51
app/Models/PushSubscription.php
Normal file
51
app/Models/PushSubscription.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user