Closed stevepop closed 9 years ago
Added a l5
branch with composer requirements for Laravel 5 and will test it in the following days with an Elastic setup. Hopefully there won't be any problems and if you want to test it right now, require it in composer using:
"fadion/bouncy": "dev-l5"
Cool! I will test it right away and feed you back. Thanks!
There is a problem with the reference to $this->package('fadion/bouncy'); in the boot() method of the BouncyServiceProvider. Call to php artisan creates the following error;
'BadMethodCallException' with message 'Call to undefined method [package]' in /Users/steve/devapps/AfgosL5/vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:226 Stack trace:
Steve
Unfortunately Laravel 5 has changed a lot in package development. I will investigate on a solution.
Updated the l5
branch with the recent changes to Laravel 5 service providers. The provider and the facade worked correctly, but it needs some setup to have a running elastic search server with indexes and all of that. I'd be grateful if you can give it a test run.
You'll need to run a composer update
and artisan vendor:publish
to publish the config files.
Hi, I gave it a go tonight and I did get past the artisan vendor:publish. However, the next issue now is that the BouncyTrait is unable to obtain the Elasticsearch configuration. This results in the following error; DICBuilder.php line 71 at DICBuilder->construct(array(array('host' => 'localhost', 'port' => '9200')), null) in Client.php line 1412 at Client->setParams(null) in Client.php line 84 at Client->construct(null) in BouncyTrait.php line 563 at Members->getElasticClient() in BouncyTrait.php line 42
You can see that it is unable to read the elasticsearch config parameters. I traced the problem to line 563 return new ElasticSearch(Config::get('bouncy::elasticsearch')); When I dumped Config::get('bouncy::elasticsearch') it returned an array of my elasticsearch configuration. However when I dumped Config::get('bouncy::elasticsearch') it returned null. The Elasticsearch client needs this to work.
You're right! L5 removed config namespaces. Updated BouncyCollectionTrait and BouncyTrait and my dumps are returning correct configuration options. Please give it another go. Don't forget composer update
.
:+1: It works now. Glad I helped to sort this out. Off to bed! :)
Glad to hear and thanks for the help. I'm closing the issue! If you find any other problem or Laravel 5 breaks something in your app, please let me know.
Thanks for your efforts to make querying Elasticsearch using Laravel a breeze. Any plans to port this to Laravel 5 support soon?