55use Nqxcode \LuceneSearch \Analyzer \Stopwords \FilterFactory ;
66use Nqxcode \LuceneSearch \Index \Connection ;
77use Nqxcode \LuceneSearch \Model \Config as ModelsConfig ;
8- use Nqxcode \LuceneSearch \Pagination \Factory ;
98use ZendSearch \Lucene \Analysis \Analyzer \Common \Utf8Num \CaseInsensitive ;
109
1110class ServiceProvider extends \Illuminate \Support \ServiceProvider
@@ -25,7 +24,7 @@ class ServiceProvider extends \Illuminate\Support\ServiceProvider
2524 */
2625 public function boot ()
2726 {
28- $ this ->package ( ' nqxcode/ laravel-lucene-search ' );
27+ $ this ->mergeConfigFrom ( __DIR__ . ' /../../config/config.php ' , ' laravel-lucene-search ' );
2928 }
3029
3130 /**
@@ -35,14 +34,18 @@ public function boot()
3534 */
3635 public function register ()
3736 {
37+ $ this ->publishes ([
38+ __DIR__ .'/../../config/config.php ' => config_path ('laravel-lucene-search.php ' ),
39+ ]);
40+
3841 $ this ->app ->bind ('Nqxcode\LuceneSearch\Search ' , function ($ app ) {
3942 return $ app ['search ' ];
4043 });
4144
4245 $ this ->app ->bindShared ('search ' , function ($ app ) {
4346 return new Search (
44- $ app ['search.connection ' ],
45- $ app ['search.models.config ' ]
47+ $ app ['laravel-lucene- search.connection ' ],
48+ $ app ['laravel-lucene- search.models.config ' ]
4649 );
4750 });
4851
@@ -52,26 +55,26 @@ public function register()
5255
5356 $ this ->app ->bind ('Nqxcode\LuceneSearch\Analyzer\Config ' , function () {
5457 return new AnalyzerConfig (
55- Config::get ('laravel-lucene-search:: analyzer.filters ' , []),
56- Config::get ('laravel-lucene-search:: analyzer.stopwords ' , []),
58+ Config::get ('laravel-lucene-search. analyzer.filters ' , []),
59+ Config::get ('laravel-lucene-search. analyzer.stopwords ' , []),
5760 new FilterFactory
5861 );
5962 });
6063
61- $ this ->app ->bindShared ('search.index.path ' , function () {
62- return Config::get ('laravel-lucene-search:: index.path ' );
64+ $ this ->app ->bindShared ('laravel-lucene- search.index.path ' , function () {
65+ return Config::get ('laravel-lucene-search. index.path ' );
6366 });
6467
65- $ this ->app ->bindShared ('search.connection ' , function ($ app ) {
68+ $ this ->app ->bindShared ('laravel-lucene- search.connection ' , function ($ app ) {
6669 return new Connection (
67- $ app ['search.index.path ' ],
70+ $ app ['laravel-lucene- search.index.path ' ],
6871 $ app ->make ('Nqxcode\LuceneSearch\Analyzer\Config ' )
6972 );
7073 });
7174
72- $ this ->app ->bindShared ('search.models.config ' , function ($ app ) {
75+ $ this ->app ->bindShared ('laravel-lucene- search.models.config ' , function ($ app ) {
7376 return new ModelsConfig (
74- Config::get ('laravel-lucene-search:: index.models ' ),
77+ Config::get ('laravel-lucene-search. index.models ' ),
7578 $ app ->make ('Nqxcode\LuceneSearch\Model\Factory ' )
7679 );
7780 });
0 commit comments