PushNotificationLog.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace App\Models;
  3. use App\Enums\PushNotificationTargetEnum;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. /**
  7. * @property int $id
  8. * @property string $label
  9. * @property string|null $title
  10. * @property string|null $body
  11. * @property int $user_id
  12. * @property PushNotificationTargetEnum $target
  13. * @property string $category
  14. * @property \Illuminate\Support\Carbon $sent_at
  15. * @property \Illuminate\Support\Carbon|null $created_at
  16. * @property \Illuminate\Support\Carbon|null $updated_at
  17. * @property-read \App\Models\User $user
  18. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog newModelQuery()
  19. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog newQuery()
  20. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog query()
  21. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereCategory($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereBody($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereTitle($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereCreatedAt($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereId($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereLabel($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereSentAt($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereTarget($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereUpdatedAt($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder<static>|PushNotificationLog whereUserId($value)
  31. * @mixin \Eloquent
  32. */
  33. class PushNotificationLog extends Model
  34. {
  35. protected $guarded = ['id'];
  36. protected $casts = [
  37. 'sent_at' => 'datetime',
  38. 'target' => PushNotificationTargetEnum::class,
  39. ];
  40. public function user(): BelongsTo
  41. {
  42. return $this->belongsTo(User::class);
  43. }
  44. }