2017 © Pedro Peláez
 

library seo

Provides 404 page logging and redirecting for Laravel 5+

image

knash94/seo

Provides 404 page logging and redirecting for Laravel 5+

  • Saturday, May 12, 2018
  • by knash94
  • Repository
  • 2 Watchers
  • 3 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 12 Versions
  • 42 % Grown

The README.md

Laravel SEO Tools

Total Downloads Latest Stable Version License Build Status, (*1)

A laravel 5 package that adds the ability to log 404 errors and to action these with redirects via a user interface. This has several benefits over creating redirect in a .htaccess (Or your web servers equivalent) as the main laravel application will run and then 404 if a page cannot be found, this is where the package will determine whether there is a redirect available. This prevents scenarios where a redirect may be hit before laravel and limiting access to your application. On top of this, it gives SEO members the ability to track 404 errors, tracking where they have come from and then action them with ease., (*2)

Installation

Install the package with composer, (*3)

composer require knash94\seo

Once installed, add the following line into your config/app.php service providers, (*4)

'Knash94\Seo\SeoServiceProvider'

Then open your \App\Exceptions\Handler.php file and insert the following code under the render method, be sure not to change any existing code on the method, (*5)

$redirect = $this->reportNotFound($exception);

if ($redirect && $redirect instanceof RedirectResponse) {
    return $redirect;
}
````
Also add the `LogsMissingPages` trait to `\App\Exceptions\Handler.php`
```php
use LogsMissingPages;
````

Also import the `Illuminate\Http\RedirectResponse;` in `App\Exceptions\Handler.php`


Finally, publish the vendor files and run the migrations by running these commands

php artisan vendor:publish --provider=Knash94\Seo\SeoServiceProvider php artisan migrate, (*6)


## Configuration There are various configuration options to choose from, I'd recommend setting the `middleware`, `template` and `section` values. Simply open seo-tools.php and set the new values. Below is an example setup using your own template ```php <?php return [ 'routing' => [ 'prefix' => 'admin/seo-tools', 'namespace' => 'Knash94\Seo\Http\Controllers', 'middleware' => ['auth'] ], 'views' => [ 'template' => 'layout.admin', 'section' => 'content', 'index' => 'seo-tools::bootstrap3.index', 'errors' => [ 'edit' => 'seo-tools::bootstrap3.errors.edit', 'view' => 'seo-tools::bootstrap3.errors.view' ], 'redirects' => [ 'edit' => 'seo-tools::bootstrap3.redirects.edit', 'delete' => 'seo-tools::bootstrap3.redirects.delete' ] ], // Filters what URLs to not record using regex 'filters' => [ '/(\.png)|(\.jpg)|(\.gif)/', '/wp\-login\.php/' ] ];

If you want to link the redirect manager into your admin panel, then create a link to the seo-tools.index route, (*7)

Todo

  • Testing suite
  • Ability to test if a redirect works as intended before applying the change
  • To mass insert redirects
  • Ability to add regex into redirects

The Versions

12/05 2018

dev-travis-setup

dev-travis-setup

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Nash

18/03 2018

dev-master

9999999-dev

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Nash

18/03 2018

v1.2.1

1.2.1.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Nash

18/03 2018

dev-feature-unit-testing

dev-feature-unit-testing

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Nash

18/03 2018

v1.2.0

1.2.0.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kyle Nash

16/02 2018

v1.1.2

1.1.2.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

by Kyle Nash

16/02 2018

v1.1.1

1.1.1.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

by Kyle Nash

15/02 2018

v1.1.0

1.1.0.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

by Kyle Nash

15/02 2018

v1.0.3

1.0.3.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

by Kyle Nash

11/02 2018

v1.0.2

1.0.2.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

MIT

by Kyle Nash

11/02 2018

v1.0.1

1.0.1.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

by Kyle Nash

11/02 2018

v1.0.0

1.0.0.0

Provides 404 page logging and redirecting for Laravel 5+

  Sources   Download

by Kyle Nash