-
Notifications
You must be signed in to change notification settings - Fork 34
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
Order By on Relatable Query #1484
Comments
What's wrong with applying an |
It doesn't. I've tried changing the above code to;
I also changed to
just to illustrate how it isn't working. I've attached the result below; |
Anything new here? I'm facing the same problem.: Also tried to override the |
@dillingham showed me that the order is set in the |
This issue relates to an older version of Nova. It's possible that this bug has been fixed in recent versions. If you're still experiencing this in the latest version of Nova, please re-open this ticket, thanks! |
Have same issue.I think it's because of Nova re-sorted related resource by hard code. See Laravel\Nova\Http\Controllers\AssociatableController
|
@JordanDinsdale, Can you reopen this bug, as it is still valid at the latest Nova version (v2.6.1) The order is hardcoded and no mater what we do, it will not change. |
Hi, I don't really think "It's possible that this bug has been fixed in recent versions" is a good enough reason to close a ticket that's occuring in software that has been bought and paid for. Why didn't you check if it had been fixed, then report back...? @lab08tonci, @jbrooksuk, or anyone else; |
@JordanDinsdale we get a lot of tickets and they take a lot of time. Help us, help you. |
I am really trying, but people are closing tickets without good reason, and not telling me how I can reopen them when asked... What exactly is it that you're suggesting I should do about these things? |
@JordanDinsdale until you said that you were unable to reopen the issue, I was unaware that it was the case. We reserve the right to manage the issues at our discretion. As with all tickets, we're always reading them and keeping an eye on them. |
@jbrooksuk Thanks James, I look forward to seeing what progress you can make regarding this |
Yeah, I also can't apply my custom |
Quick fixAs a quick fix I am doing the following:
Possible long term fixAs a reasonable fix I suggest to wrap the
into a fascade like
and
The developer can either use the default sorting algorithm (sortBy('display')) or overwrite the sorting algorithm. |
This issue still exists (Nova 2.9.4) I'm trying to create a filter by altering query in apply method: It looks like the filter query is wrapped in applyOrderings method from PerformsQueries trait. |
Hello @jbrooksuk, This issue still exists in Nova v3.6.
Can you Provide any updates on this issue? It will be helpful. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Sorry for the lack of updates. In order to keep this repository focused on bug reports, we auto-close feature requests and requests for help. Feel free to post your feature requests so others can discuss and add reactions. We'll keep an eye on them for later planning. |
Hey can we get an update on sorting relatable queries. I don't think it's a new feature but a bug. Thanks. |
This comment has been minimized.
This comment has been minimized.
Is there any progress on this bug please? |
I could get rid of all the custom BS queries I've wrote in order to achieve my sorting in several resources.. getting used to it. :) |
Hi @crynobone, seems like there is no |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I need to apply an order on a relatable query in Laravel Nova.
I've tried everything on this page #156 and can't get any of the methods detailed to work with my application.
I have 3 models significant to this problem; Event, Brand and Vehicle.
Events Belong To Many Brands | Brands Belong To Many Events
Brand Has Many Vehicles | Vehicles Belong To a Brand
Event Belongs To Many Vehicles | Vehicles Belong To Many Events
When a user creates an Event, they then go on to choose Brands associated with that Event.
This is facilitated by putting the below line in the fields function in my Nova Event Resource.
BelongsToMany::make('Brand')->sortable(),
Once a user has attached associated Brands, they then go on to attach associated Vehicles.
The list of Vehicles is populated using a relatable query that I have in my Nova Event Resource;
Now when I go to attach a Vehicle, it is populated only by Vehicles that are related to the Brands attached to the Event.
The problem is that the options in the select box provided are ordered by the title.
I have the below in my Vehicle resource, which I think is where the problem stems from;
public static $title = 'model';
But obviously I need that in the Resource so that the select box displays appropriately.
Does anyone know how I can order by something other than title instead? I'm trying to order by brand_id.
The text was updated successfully, but these errors were encountered: