{"repo":"spatie/eloquent-sortable","free":true,"listed":false,"github":"https://github.com/spatie/eloquent-sortable","clone":"git clone https://github.com/spatie/eloquent-sortable.git","description":"Sortable behaviour for Eloquent models","language":"PHP","stars":1518,"topics":["laravel","php","eloquent","sort","trait"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Sortable behaviour for Eloquent models 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. Spatie is a webdesign agency in Antwerp, Belgium. You'll find an overview of all our open source projects on our website. Support us Learn how to create a package like this one, by watching our premium video course: We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation For Laravel 6.x or PHP 7.x, use version 3.x of this package. This package can be installed through Composer. In Laravel 5.5 and above the service provider will automatically get registered. In older versions of the framework just add the service provider in config/app.php file: Optionally you can publish the config file with: This is the content of the file that will be published in config/eloquent-sortable.php Usage To add sortable behaviour to your model you must: 1. Implement the Spatie\\EloquentSortable\\Sortable interface. 2. Use the trait Spatie\\Eloq","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/eloquent-sortable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}