PHP code example of adiafora / laravel-postgres-naturalsort

1. Go to this page and download the library: Download adiafora/laravel-postgres-naturalsort 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/ */

    

adiafora / laravel-postgres-naturalsort example snippets


    composer 

    php artisan migrate


Product extends Model
{
    use \Adiafora\NaturalSort\NaturalSortTrait;
}


Product::orderByNatural('text')->get();

Product::orderByNaturalDesc('text')->get();