PHP Package: spatie/eloquent-sortable

This PHP library provides sortable behavior for Eloquent models in Laravel applications, allowing easy sorting of records. It enhances the management of data ordering and positions within databases for improved user experience and search engine optimization.

Current Version: 4.5.2
Last Updated: 2025-08-25
PHP Requirement: ^8.1
Dependencies:
illuminate/database
illuminate/support
⚠️ To ensure full functionality, the above dependencies might be required.

Package Description

Eloquent-Sortable is a feature-rich open-source PHP library designed to streamline the sorting of Eloquent models in Laravel, optimizing data arrangements for SEO and user interaction. With seamless integration and robust functionality, this package simplifies the process of handling ordered records effectively.

📦 Show all available classes🔗 View on GitHub

Download Latest Version: 4.5.2

Download Download v4.5.2

Previous Versions

Code Integration Example

Make sure to include the correct namespace and class paths for proper usage.

<?php
// Example from PHPlibraries.com
require_once 'libs/spatie/eloquent-sortable/4.5.2/loader.php';
require_once 'libs/illuminate/database/12.33.0/loader.php';
require_once 'libs/illuminate/support/12.33.0/loader.php';

use Illuminate\Database\Eloquent\Model;
use Spatie\EloquentSortable\Sortable;
use Spatie\EloquentSortable\SortableTrait;

$obj = new Model();
echo '✅ Test OK: ' . get_class($obj);
?>

We aim to make using PHP packages easier without Composer. If something doesn't work, let us know — we'll fix it promptly.

Community Discussion

Ask questions, share tips, or report issues below.