Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Add sitemap service alias to provides method to prevent BindingResolu…
Browse files Browse the repository at this point in the history
…tionException

Because the service provider is deferred, we need to tell the application that it provides the Sitemap class in order to inject it properly.
  • Loading branch information
hackel authored Oct 5, 2016
1 parent 00f9920 commit 7a69806
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Roumen/Sitemap/SitemapServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php namespace Roumen\Sitemap;

use Illuminate\Support\ServiceProvider;
use Roumen\Sitemap\Sitemap;

class SitemapServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -51,7 +52,7 @@ public function register()
return new Sitemap($config);
});

$this->app->alias('sitemap','Roumen\Sitemap\Sitemap');
$this->app->alias('sitemap', Sitemap::class);
}

/**
Expand All @@ -61,6 +62,6 @@ public function register()
*/
public function provides()
{
return ['sitemap'];
return ['sitemap', Sitemap::class];
}
}

0 comments on commit 7a69806

Please sign in to comment.