'datetime', 'accepted_at' => 'datetime', ]; } /** @return BelongsTo */ public function space(): BelongsTo { return $this->belongsTo(Space::class); } /** @return BelongsTo */ public function invitedBy(): BelongsTo { return $this->belongsTo(User::class, 'invited_by_id'); } public function isExpired(): bool { return $this->expires_at !== null && $this->expires_at->isPast(); } public function isAccepted(): bool { return $this->accepted_at !== null; } }