2017 © Pedro Peláez
 

library seopagination

Laravel SEO Pagination

image

agelxnash/seopagination

Laravel SEO Pagination

  • Wednesday, May 3, 2017
  • by Agel Nash
  • Repository
  • 1 Watchers
  • 6 Stars
  • 606 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 20 Versions
  • 0 % Grown

The README.md

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., (*1)

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

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

php composer.phar require agelxnash/seopagination:1.0.*

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, (*3)

AgelxNash\SEOPagination\PaginationServiceProvider

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., (*4)

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

Now you can edit the file config/seo-pagination.php, (*5)

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, (*6)

Usage

Add the trait to your model, (*7)

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:, (*8)

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;
}

The Versions

03/05 2017

dev-laravel-5.2

dev-laravel-5.2

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

03/05 2017

5.2.2

5.2.2.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

03/05 2017

dev-laravel-5.1

dev-laravel-5.1

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

03/05 2017

5.1.5

5.1.5.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

13/02 2017

5.1.4

5.1.4.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

13/02 2017

5.2.1

5.2.1.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

28/06 2016

5.2.0

5.2.0.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

31/08 2015

5.1.3

5.1.3.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

31/08 2015

dev-laravel-5.0

dev-laravel-5.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

31/08 2015

5.0.2

5.0.2.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

31/08 2015

5.1.2

5.1.2.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

24/08 2015

5.0.1

5.0.1.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

24/08 2015

5.1.1

5.1.1.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

5.0.0

5.0.0.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

5.1.0

5.1.0.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

dev-laravel-4.0

dev-laravel-4.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

4.0.0

4.0.0.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

dev-laravel-4.2

dev-laravel-4.2

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

4.2.0

4.2.0.0

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

laravel page pagination list seo paginator

19/08 2015

dev-master

9999999-dev

Laravel SEO Pagination

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

laravel page pagination list seo paginator