Skip to content

Commit

Permalink
remove scout service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
basemkhirat committed Feb 18, 2017
1 parent c616556 commit d52175c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},

"require-dev": {
"laravel/scout": "*",
"phpunit/phpunit": "*"
}

Expand Down
23 changes: 12 additions & 11 deletions src/ElasticsearchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,20 @@ public function boot()

// Resolve Laravel Scout engine.

$this->app->make(EngineManager::class)->extend('es', function () {
if(class_exists("Laravel\\Scout\\EngineManager")) {

$config = config('es.connections.' . config('scout.es.connection'));
$this->app->make(EngineManager::class)->extend('es', function () {

return new ScoutEngine(
ElasticBuilder::create()->setHosts($config["servers"])->build(),
$config["index"]
);
$config = config('es.connections.' . config('scout.es.connection'));

});
return new ScoutEngine(
ElasticBuilder::create()->setHosts($config["servers"])->build(),
$config["index"]
);

});

}


}
Expand All @@ -56,12 +60,9 @@ public function boot()
public function register()
{

// Register laravel scout service provider.

$this->app->register("Laravel\\Scout\\ScoutServiceProvider");

$this->app->bind('es', function () {
return new Connection();
});

}
}

0 comments on commit d52175c

Please sign in to comment.