'datetime']; } /** * @return BelongsTo */ public function user(): BelongsTo { return $this->belongsTo(User::class); } /** * @param Builder<$this> $query * @return Builder<$this> */ public function scopeFailed(Builder $query): Builder { return $query->where('status', '>=', 400); } /** * Everything a given user's own tokens did. * * Matched on the token's owner rather than on `user_id` alone so a * revoked token's history stays visible to the person who created it — * which is exactly when someone goes looking. * * @param Builder<$this> $query * @return Builder<$this> */ public function scopeOwnedBy(Builder $query, User $user): Builder { return $query->where('user_id', $user->id); } }