PHP code example of larahook / distinct-on-pagination

1. Go to this page and download the library: Download larahook/distinct-on-pagination 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/ */

    

larahook / distinct-on-pagination example snippets


class SomeModel extends Model
{
    use DistinctOnPagination; // <-- add DistinctOnPagination trait
    use HasFactory;

    /** @var string */
    protected $table = 'some_table';
}
composer
php artisan vendor:publish --provider="Larahook\DistinctOnPagination\DistinctOnPaginationServiceProvider" --tag=config