Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting has no effect when a relation has same class than the model #98

Open
olivierbaudouin opened this issue Jan 10, 2025 · 0 comments

Comments

@olivierbaudouin
Copy link

Steps to reproduce:

  1. In users migration table:
    $table->foreignId('manager_id')->nullable()->constrained('users');

  2. In User model:
    public function manager(): BelongsTo
    {
    return $this->belongsTo(User::class, 'manager_id')->select('id', 'fullname');
    }

  3. Purity sorting string : 'group.name:asc' -> no effect

All other sorting types on relation are working.

I tried with another Model (Customer that belongs to a group where group is a Customer), and this is the same problem.

@olivierbaudouin olivierbaudouin changed the title Sorting has no effect when a relation has the same class than the model Sorting has no effect when a relation has same class than the model Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant