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

wangwenfan picture wangwenfan  ·  3Comments

piian picture piian  ·  3Comments

benny-sun picture benny-sun  ·  3Comments

clock1129 picture clock1129  ·  3Comments

cdhraesaemer picture cdhraesaemer  ·  3Comments