Skip to content
Permalink
Browse files

Log errors before returing missing sitemap

  • Loading branch information...
tbuteler committed Oct 27, 2016
1 parent c66eab1 commit ad25e65a1ddb224b4dffc3315cce11b53acd1fe5
Showing with 9 additions and 4 deletions.
  1. +2 −2 readme.md
  2. +7 −2 src/Controller.php
@@ -5,12 +5,12 @@ Simple sitemaps for Laravel projects

## Installing

- Use Composer to install:
Use Composer to install:
```
composer require clumsy/sitemap
```

- In the `config/app.php` file, add this to the `providers` key:
In the `config/app.php` file, add this to the `providers` key:
```php
Clumsy\Sitemap\SitemapServiceProvider::class,
```
@@ -3,17 +3,21 @@
namespace Clumsy\Sitemap;
use ArrayAccess;
use Illuminate\Foundation\Application;
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
{
protected $sitemap;
protected $app;
protected $groups;
public function __construct()
public function __construct(Application $app)
{
$this->sitemap = new Sitemap;
$this->app = $app;
}
protected function missing()
@@ -77,7 +81,8 @@ public function render()
$this->groups = include $path;
} catch (\Exception $e) {
// Log the exception before returning a 404
$this->app->log->error($e);
return $this->missing();
}

0 comments on commit ad25e65

Please sign in to comment.
You can’t perform that action at this time.