diff --git a/readme.md b/readme.md index 8b8e0ed..1d6da60 100644 --- a/readme.md +++ b/readme.md @@ -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, ``` diff --git a/src/Controller.php b/src/Controller.php index 1e22927..7e02d2f 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -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(); }