Laravel-admin: orderable is not working

Created on 13 Jun 2017  路  1Comment  路  Source: z-song/laravel-admin

protected function handleOrderable($id, array $input = [])
{
if (array_key_exists('_orderable', $input)) {

        $model = $this->model->find($id);

        if ($model instanceof Sortable) {
            $input['_orderable'] == 1 ? $model->moveOrderUp() : $model->moveOrderDown();
            return true;
        }

    }

    return false;
}

Most helpful comment

For what i see in the Orderable Displayer, you need to require spatie/eloquent-sortable first

composer require spatie/eloquent-sortable

But the code seems to be incomplete. If i manage to arrive to a solution, will post it here.

>All comments

For what i see in the Orderable Displayer, you need to require spatie/eloquent-sortable first

composer require spatie/eloquent-sortable

But the code seems to be incomplete. If i manage to arrive to a solution, will post it here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

taimaiduc picture taimaiduc  路  3Comments

evans-kim picture evans-kim  路  3Comments

fokoz picture fokoz  路  3Comments

abufalbo picture abufalbo  路  3Comments

amun1303 picture amun1303  路  3Comments