Skip to main content

Code Examples of spatie/eloquent-sortable

Discover how to use Laravel's spatie/eloquent-sortable method in real-world applications. Browse 1 examples from popular open-source projects.

1 example
This package provides a trait that adds sortable behaviour to an Eloquent model.
The value of the order column of a new record of a model is determined by the maximum value of the order column of all records of that model + 1.
The package also provides a query scope to fetch all the records in the right order.
Read more on the official Github.

LaraBug/larabug-app

  • 218
  • Created Apr 2021
  • Updated Oct 2023

Files in this example

  • composer.json
    • app/Models/Documentation.php
View full example

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.