Skip to content

Commit f852ae5

Browse files
Merge pull request #61 from kirschbaum-development/feature/drag-drop-column
Use a column for dragging and dropping
2 parents 8f9192e + d510de6 commit f852ae5

18 files changed

Lines changed: 358 additions & 17423 deletions

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ You can also update, re-arrange (for one-to-many relationships), and delete rela
6767

6868
![Rearrange Models](https://raw.githubusercontent.com/kirschbaum-development/nova-inline-relationship/master/screenshots/UpdateView.png "Rearrange Models")
6969

70+
You can add drag and drop functionality for related models to update their order by using the `sortUsing()` method. In the following code example we use a field named `order` to store the sort order for the `Images` model:
71+
72+
```php
73+
HasMany::make('Images')->inline()->sortUsing('order'),
74+
75+
7076
## Required Relationships
7177

7278
Occasionally you may want to require a child relationship during the creation of a model. To do this, just use the `requireChild()` method. As an example, you may want to create a new user and enforce that a new profile for the user is also created.

0 commit comments

Comments
 (0)