<?php

namespace Tricks\LaravelTools\Traits;

use Illuminate\Database\Eloquent\Builder;
use Laravel\Nova\Http\Requests\NovaRequest;
use Outl1ne\NovaSortable\Traits\HasSortableRows;

trait HasExtendedSortableRows
{
    use HasSortableRows {
        indexQuery as sortableIndexQuery;
    }

    /**
     * @param  Builder  $query
     * @return Builder
     */
    public static function indexQuery(NovaRequest $request, $query)
    {
        return parent::indexQuery($request, static::sortableIndexQuery($request, $query));
    }
}
