Skip to content

Bogus error on Eloquent orderBy() #180

Closed

Description

@CicerBro

PHPantom version

Master

Installation method

Built from source

Operating system

macOS aarch64 (Apple Silicon)

Editor

VS Code

Bug description

->orderBy('id', 'desc'); afaik 'desc' is fine here.

Image

But console error shows:

Argument 2 ($direction) expects SortDirection|'asc'|'desc', got string

Unrelated. But I also noticed PHPantom shows errors on files that arent open in the editor. Like in this instance I hovered the 'orderBy()method in Cursor so it shows the method signature in a popover. And my console got filled with PHPAntom type_mismatch_argument errors from the LaravelDatabase/Query/Builder.php` file.

Steps to reproduce

N/A

Error output or panic trace


.phpantom.toml

Additional context

No response

Activity

  1. changed the title [-]Bogus error on Eloquent[/-] [+]Bogus error on Eloquent orderBy()[/+] on Jul 1, 2026
  2. added 2 commits that reference this issue on Jul 4, 2026
    fa1deec
    31cc5e2
  3. CicerBro commented on Jul 4, 2026

    @CicerBro
    Author

    Many thanks, again :-) Will make a new issue for the second "bug" in a moment.

  4. CicerBro commented on Jul 27, 2026

    @CicerBro
    Author

    This error seems to have returned in the latest build from master @calebdw

    $query->orderBy('diff_percent', $shouldRename ? 'asc' : 'desc');

    "message": "Argument 2 ($direction) expects SortDirection|'asc'|'desc', got string"

  5. reopened this on Jul 27, 2026
  6. added a commit that references this issue on Jul 28, 2026
    d816150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions