Package Data | |
---|---|
Maintainer Username: | krossroad |
Maintainer Contact: | rikesh.shrestha.npl@gmail.com (Rikesh) |
Package Create Date: | 2017-09-23 |
Package Last Update: | 2023-02-20 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-22 15:05:00 |
Package Statistics | |
---|---|
Total Downloads: | 98,736 |
Monthly Downloads: | 452 |
Daily Downloads: | 1 |
Total Stars: | 19 |
Total Watchers: | 2 |
Total Forks: | 5 |
Total Open Issues: | 2 |
For Laravel v5.5 to v5.7
composer require 'krossroad/laravel-union-paginator:5.5'
For Laravel v5.2 to v5.4
composer require 'krossroad/laravel-union-paginator:5.4'
Just use
UnionPaginatorTrait
in your model and you are good to go.
<?php
/**
* @filename {project}/App/Models/User.php
*/
namespace \App\Models\User;
use Krossroad\UnionPaginator\UnionPaginatorTrait;
class User extends Model
{
use UnionPaginatorTrait;
...
}
->unionPaginate()
--> returns \Illuminate\Pagination\LengthAwarePaginator instance
$first = User::whereNull('first_name');
$pagination = User::whereNull('last_name')
->union($first)
->unionPaginate(
$perPage,
$columns,
$pageName = 'page',
$page
);
If you find any bug, issue or have queries. Please create a new issue