z-song/laravel-admin · error · Exception

To use orderable grid, please install package [spatie/eloque

Error message

To use orderable grid, please install package [spatie/eloquent-sortable] first.

What it means

Error "To use orderable grid, please install package [spatie/eloquent-sortable] first." thrown in z-song/laravel-admin.

Source

Thrown at src/Grid/Displayers/Orderable.php:12

<?php

namespace Encore\Admin\Grid\Displayers;

use Encore\Admin\Admin;

class Orderable extends AbstractDisplayer
{
    public function display()
    {
        if (!trait_exists('\Spatie\EloquentSortable\SortableTrait')) {
            throw new \Exception('To use orderable grid, please install package [spatie/eloquent-sortable] first.');
        }

        Admin::script($this->script());

        return <<<EOT

<div class="btn-group">
    <button type="button" class="btn btn-xs btn-info {$this->grid->getGridRowName()}-orderable" data-id="{$this->getKey()}" data-direction="1">
        <i class="fa fa-caret-up fa-fw"></i>
    </button>
    <button type="button" class="btn btn-xs btn-default {$this->grid->getGridRowName()}-orderable" data-id="{$this->getKey()}" data-direction="0">
        <i class="fa fa-caret-down fa-fw"></i>
    </button>
</div>

EOT;
    }

View on GitHub (pinned to 67c441eb78)

When it happens

Trigger: Thrown at src/Grid/Displayers/Orderable.php:12 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of z-song/laravel-admin@67c441eb78 (2026-08-21). Data as JSON: /api/errors/097de14f3ebac2c6. Report an issue: GitHub.