NotificationRecipient.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * @property int $id
  7. * @property int $notification_id
  8. * @property int|null $user_id
  9. * @property int|null $unit_id
  10. * @property int|null $franchisee_id
  11. * @property bool $is_read
  12. * @property string|null $read_at
  13. * @property string $channel
  14. * @property bool $is_delivered
  15. * @property string|null $delivered_at
  16. * @property string|null $delivery_error
  17. * @property \Illuminate\Support\Carbon|null $created_at
  18. * @property \Illuminate\Support\Carbon|null $updated_at
  19. * @property string|null $deleted_at
  20. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient newModelQuery()
  21. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient newQuery()
  22. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient query()
  23. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereChannel($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereCreatedAt($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereDeletedAt($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereDeliveredAt($value)
  27. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereDeliveryError($value)
  28. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereFranchiseeId($value)
  29. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereId($value)
  30. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereIsDelivered($value)
  31. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereIsRead($value)
  32. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereNotificationId($value)
  33. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereReadAt($value)
  34. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereUnitId($value)
  35. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereUpdatedAt($value)
  36. * @method static \Illuminate\Database\Eloquent\Builder<static>|NotificationRecipient whereUserId($value)
  37. * @mixin \Eloquent
  38. */
  39. class NotificationRecipient extends Model
  40. {
  41. use HasFactory;
  42. protected $table = 'notification_recipients';
  43. protected $guarded = [
  44. 'id', // Add more fields that shouldn't be edited here
  45. ];
  46. protected $casts = [
  47. 'is_read' => 'boolean',
  48. 'read_at' => 'datetime',
  49. 'is_delivered' => 'boolean',
  50. 'delivered_at' => 'datetime',
  51. 'created_at' => 'datetime',
  52. 'updated_at' => 'datetime',
  53. ];
  54. // Relationships
  55. public function notification(): \Illuminate\Database\Eloquent\Relations\BelongsTo
  56. {
  57. return $this->belongsTo(Notification::class, 'notification_id');
  58. }
  59. public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
  60. {
  61. return $this->belongsTo(User::class, 'user_id');
  62. }
  63. // Business Logic Methods
  64. // Custom Finders
  65. // Query Scopes
  66. }