New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

agelxnash/seopagination

Laravel SEO Pagination
1,046 6

Larablocks Analysis

agelxnash/seopagination works with any PHP project: the latest release (5.2.2, May 3, 2017) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: May 3, 2017)
  • 10 downloads a month (needs 10,000)
  • 6 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: May 3, 2017.
  • No releases in the last 12 months.
  • First released: Aug 19, 2015.
  • Monthly downloads: 10.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.

Install
composer require agelxnash/seopagination
Latest Version:5.2.2
PHP:>=5.4.0
License:MIT
Last Updated:May 3, 2017
Links: GitHub  ·  Packagist
Maintainer: Agel Nash

Laravel SEO Pagination

This extension pack pagination laravel. With it, you can prevent the opening of blank pages. For example, in your pagination has only 10 pages, but the user has requested page with number 101. With this extension pack, user redirected to the last (10) or first page... or send 404 error.

And most importantly, paginator now contains no reference to the first page with the GET variable.

Old

http://example.com/news?page=1
http://example.com/news?page=2
http://example.com/news?page=3
...
etc.

New

http://example.com/news
http://example.com/news?page=2
http://example.com/news?page=3
...
etc.

Installation

Step 1

composer require agelxnash/seopagination:5.2.*@dev

Step 2

Once SEOPagination is installed you need to register the service provider with the application. Open up config/app.php and replace Illuminate\Pagination\PaginationServiceProvider the providers key to

AgelxNash\SEOPagination\PaginationServiceProvider::class

Configuration

You will want to run the following command to publish the config to your application, otherwise it will be overwritten when the package is updated.

php artisan vendor:publish --provider="AgelxNash\SEOPagination\PaginationServiceProvider"

Now you can edit the file config/seo-pagination.php

action_on_error

  • first (Send redirect to first pagination page with error_status response status code)
  • out (Send redirect to end pagination page with error_status response status code)
  • abort (Return 404 error. Not use error_status)

error_status

Any response status code. For example - 307 (default) or 301

Usage

Add the trait to your model

use Illuminate\Database\Eloquent\Model;

Class Post extends Model{
	use \AgelxNash\SEOPagination\Eloquent\ReplaceBuilder
}

After the call paginate() method, you can check data variable in the method checkPaginate(). The result will be object \Illuminate\Http\RedirectResponse or true Look at the example method of a controller with check pagination:

public function example()
{
	$posts = Post::->orderBy('created_at', 'DESC')->paginate(10);
	if(($out = $posts->checkPaginate()) === true){
		$out = View::make('index', array('data'=> $posts));
	}
	return $out;
}

Alternatives to agelxnash/seopagination

lampager/lampager-laravel

Rapid pagination for Laravel

46,520 76
ge-tracker/laravel-redis-paginator

Create a Laravel Paginator or LengthAwarePaginator from a Redis sorted set

6,779 5
madeitbelgium/seo-analyzer

SEO Analyzer

7,422 32
s-damian/laravel-man-pagination

Laravel Pagination library

2,982 2

Version History

Version Released PHP License
5.2.2 >=5.4.0 MIT
5.2.1 >=5.4.0 MIT
5.2.0 >=5.4.0 MIT
5.1.5 >=5.4.0 MIT
5.1.4 >=5.4.0 MIT