Skip to content
Snippets Groups Projects
Commit 232dbfca authored by Kevin Hill's avatar Kevin Hill
Browse files

updating the service provider for laravel to use singleton over share,

since it was removed in laravel 5.4. Should fix issue #175
parent fc42fc61
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -13,7 +13,7 @@ use Illuminate\Support\Facades\Facade;
* @package Khill\Lavacharts
* @subpackage Laravel
* @author Kevin Hill <kevinkhill@gmail.com>
* @copyright (c) 2015, KHill Designs
* @copyright (c) 2017, KHill Designs
* @link http://github.com/kevinkhill/lavacharts GitHub Repository Page
* @link http://lavacharts.com Official Docs Site
* @license http://opensource.org/licenses/MIT MIT
Loading
Loading
Loading
Loading
@@ -16,14 +16,14 @@ use \Illuminate\Foundation\AliasLoader;
* @package Khill\Lavacharts
* @subpackage Laravel
* @author Kevin Hill <kevinkhill@gmail.com>
* @copyright (c) 2015, KHill Designs
* @copyright (c) 2017, KHill Designs
* @link http://github.com/kevinkhill/lavacharts GitHub Repository Page
* @link http://lavacharts.com Official Docs Site
* @license http://opensource.org/licenses/MIT MIT
*/
class LavachartsServiceProvider extends ServiceProvider
{
protected $defer = false;
protected $defer = true;
 
public function boot()
{
Loading
Loading
@@ -39,22 +39,20 @@ class LavachartsServiceProvider extends ServiceProvider
 
public function register()
{
$this->app['lavacharts'] = $this->app->share(
function () {
return new Lavacharts;
}
);
$this->app->booting(
function () {
$loader = AliasLoader::getInstance();
$loader->alias('Lava', 'Khill\Lavacharts\Laravel\LavachartsFacade');
}
);
$this->app->singleton('lavacharts', function() {
return new Lavacharts;
});
$this->app->booting(function() {
$loader = AliasLoader::getInstance();
$loader->alias('Lava', 'Khill\Lavacharts\Laravel\LavachartsFacade');
});
}
 
public function provides()
{
return ['lavacharts'];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment