| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Factories\HasFactory;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
- class NotificationDeliveryLog extends Model
- {
- use HasFactory;
- public const CHANNEL_IN_APP = 'in_app';
- public const CHANNEL_BROWSER = 'browser';
- public const CHANNEL_PUSH = 'push';
- public const CHANNEL_EMAIL = 'email';
- public const STATUS_SENT = 'sent';
- public const STATUS_FAILED = 'failed';
- public const STATUS_SKIPPED = 'skipped';
- public const STATUS_DEAD_LETTER = 'dead_letter';
- public const DEFAULT_SORT_BY = 'created_at';
- public const DEFAULT_ORDER_BY = 'desc';
- protected $fillable = [
- 'user_notification_id',
- 'user_id',
- 'channel',
- 'status',
- 'attempt',
- 'message',
- 'error',
- ];
- public function user(): BelongsTo
- {
- return $this->belongsTo(User::class);
- }
- public function userNotification(): BelongsTo
- {
- return $this->belongsTo(UserNotification::class);
- }
- }
|