PHP code example of signifly / nova-order-field

1. Go to this page and download the library: Download signifly/nova-order-field library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

signifly / nova-order-field example snippets


public function buildSortQuery()
{
    return static::query()->where('user_id', $this->user_id);
}

use Signifly\Nova\Fields\Order\Orderable;
use Signifly\Nova\Fields\Order\OrderField;

class Page extends Resource
{
    use Orderable;
    
    public static $defaultOrderField = 'order';
    
    public function fields(Request $request)
    {
        return [
            OrderField::make('Order'),
        ];
    }
}