'integer', ]; } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * Whether this row is the request reading it right now — the one session * this screen must never offer to end, because doing so would sign out * the person clicking the button mid-click. */ public function isCurrent(): bool { return $this->id === session()->getId(); } /** * @param Builder<$this> $query * @return Builder<$this> */ public function scopeRecent(Builder $query): Builder { return $query->orderByDesc('last_activity'); } }