Voyager: New Feature Suggestion - Order Fields

Created on 22 Mar 2017  路  10Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.
  • Voyager Version: 0.11.7
  • PHP Version: 7.0.15 & 7.1.1
  • Database Driver & Version: MySQL 5.6.35 & MariaDB

Description:

First of all thank you for creating one of best CRUD system I've used for Laravel. Respect for the people who build it!!
One of the things I would suggest is to order fields, just like the menu items.

Or some new param we could use in the details json, and use it for the order.

{
  "order": "1"
}

Until this feature is available what I did was add a new column to this table_rows (order) , and edit the query to return the fields order by order. But as you can imagine it's not a solution...

Regards

feature in progress

Most helpful comment

I mange to "solve" this, using jquery sortable. Not the best solution, but will do until further updates. Since I've used my own views and controllers, wont break anything if the team releases this feature. Meanwhile this will do

voyager_order

If anyone is interested I'll post my workaround to solve it

All 10 comments

I also approve the implementation of the order field.

I mange to "solve" this, using jquery sortable. Not the best solution, but will do until further updates. Since I've used my own views and controllers, wont break anything if the team releases this feature. Meanwhile this will do

voyager_order

If anyone is interested I'll post my workaround to solve it

The only use-case I can see for this is within the database editor itself, which shouldn't be used frequently (if at all) once an app is "complete". If you need the fields stored in the DB in a specific order, then you're either worried about DB performance due to MASSIVE amounts of data (and should probably be using something other than Voyager to give you more fine-grained control over that), or are likely misusing Eloquent with your queries to get data out of the DB (and should probably look at that).

I don't personally see a need for Voyager to support this, though I welcome anyone to provide use-cases in an attempt to convince me.

This is need for to have possibillity to display fields in the certain order on edit page, and not in the one in which they were created. As @nunomsh said, "just like the menu items".

In my case I created a table with 10 fields, according the needs for my project, but then I notice I missed a few ones.
Since it's a form, with a certain logic doesn't make sense to create the name, email, etc and in the bottom you have the email, because you forgot to created it...

Of course you can do a custom view like the posts, and display it as you like, but after the app is "complete", if you need aditional field you'll need to view.
This "solution" allows to create and order fields without edit the code.

This is a great feature to have on the Database BREAD.
I was about to implement this, but since it's using a table, the drag-n-drop effect will look quite ugly, like the image you've sent. This can be sort out using divs, maybe, but will take a while to rebuild.

I also don't see the need of doing this, besides the BREAD.

If you do it, do it right!! don't f*ck the UI, please! :)

@fletch3555 I like possibility order fields in edit or add page because imagine that (this happen to me all the time) when I create new table most of time I only create a field title but after I need a slug field and this stay on bottom of edit and add page but if exist one option to order it I like it after title field..

This features would beautifully complete this awesome Voyager !

Ideally, ordering would be possible for both "browse" and "add-edit" views ;)

I'm working on this, almost done ^^

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zzpwestlife picture zzpwestlife  路  3Comments

kevinjon27 picture kevinjon27  路  3Comments

vaggelis2018 picture vaggelis2018  路  3Comments

ferrywae picture ferrywae  路  4Comments

Nagendra1421 picture Nagendra1421  路  3Comments