lunar
lunar copied to clipboard
Enhancement `HasPosition` trait
Adds a HasPosition
trait for models that require a (manual) sort key, using a numeric position
column in the model's table.
Features:
- [x] Automatic assignment of the next sort key value if not explicitly defined
- [x] Automatic checking and, if necessary, correction of invalid sort key values
- [x] Limiting the validation and correcting the sort key values based on the data of other columns in the table
- [x]
Blueprint
macro to addposition
columns with the required unique constriants in migration files - [x] Convert current position columns and values to work with the trait
To do:
- [ ] Add tests
- [ ] If necessary, consider
position
columns inpivot
tables. - [ ] Documentation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
lunar-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 3, 2023 3:09am |
@glennjacobs and @alecritson, before I spend more time into this, what do you think about using the spatie/eloquent-sortable package for manual sorting instead. It should cover all requirements for lunar and works well with the upcoming admin ui based on filament, even if the example is for filament version 2.
@glennjacobs and @alecritson, before I spend more time into this, what do you think about using the spatie/eloquent-sortable package for manual sorting instead. It should cover all requirements for lunar and works well with the upcoming admin ui based on filament, even if the example is for filament version 2.
Sorry, only just seen this. Yes, I think using Spatie's package could have some advantages, we just need to be careful that it doesn't conflict with anything we may have done, e.g. ordering etc.
Also, you'll want to target 0.8 for this now, thanks.
Closing as this PR has had a status of "Draft" for a long time and our focus is now moving to 1.x.