PHPackages                             knash94/seo - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. knash94/seo

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

knash94/seo
===========

Provides 404 page logging and redirecting for Laravel 5+

v1.2.2(7y ago)41632[1 issues](https://github.com/knash94/seo/issues)MITPHP

Since Feb 11Pushed 7y ago3 watchersCompare

[ Source](https://github.com/knash94/seo)[ Packagist](https://packagist.org/packages/knash94/seo)[ RSS](/packages/knash94-seo/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (14)Used By (0)

Laravel SEO Tools
=================

[](#laravel-seo-tools)

[![Total Downloads](https://camo.githubusercontent.com/b789bbaea330c4de63368781440b16962434d3e42ee0317fe12b5e9ae874739e/68747470733a2f2f706f7365722e707567782e6f72672f6b6e61736839342f73656f2f642f746f74616c2e737667)](https://packagist.org/packages/knash94/seo)[![Latest Stable Version](https://camo.githubusercontent.com/cef75b9c9832fe28f1ac50713a7667c0487608dce85cd171e56e2a682a71abc3/68747470733a2f2f706f7365722e707567782e6f72672f6b6e61736839342f73656f2f762f737461626c652e737667)](https://packagist.org/packages/knash94/seo)[![License](https://camo.githubusercontent.com/da2d5e569b0ecc4e3320c095fc0e6276b777df2e6c87ef222f4c7de19ddff546/68747470733a2f2f706f7365722e707567782e6f72672f6b6e61736839342f73656f2f6c6963656e73652e737667)](https://packagist.org/packages/knash94/seo)[![Build Status](https://camo.githubusercontent.com/30a0341ebde166f9dfaa85bb16304a79186aae76caa85aa6bd93698fe623bffd/68747470733a2f2f7472617669732d63692e6f72672f6b6e61736839342f73656f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/knash94/seo)

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.

Installation
------------

[](#installation)

Install the package with composer

```
composer require knash94\seo
```

Once installed, add the following line into your `config/app.php` service providers

```
'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

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

if ($redirect && $redirect instanceof RedirectResponse) {
    return $redirect;
}
```

Also add the `LogsMissingPages` trait to `\App\Exceptions\Handler.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

```

Configuration
-------------

[](#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

```
