This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

d.negativa
d.negativa

Hi guys!
Thanks for the tip on the registration service provider! here
But I am having difficulties with the configuration of mongodb for my plugin. I use this package jenssegers/laravel-mongodb.
Where do I place an array with the configuration mongodb?
And how can I register this configuration?


 'mongodb' => array(
    'driver'   => 'mongodb',
    'host'     => 'localhost',
    'port'     => 27017,
    'username' => 'username',
    'password' => 'password',
    'database' => 'database'
 )

Last updated

d.negativa
d.negativa

no one can help me?

alxy
alxy

You can update the app/config/*.php files on runtime I think. So just make sure to add the array before you call the register() method: http://laravel.com/docs/4.2/configuration#introduction

I guess, the package will use the default config location, which is -in october- the same as in a default laravel installation. (/app/config/..)

d.negativa
d.negativa

Thanks alxy!

At the moment, for me it works well.

But I would like to place the configuration for the outer package, it is the plugin that uses this package.

Last updated

alxy
alxy

Well, either check the plugin sources if you can modify the way it loads the configuration or use the "add to the config-array-on-runtime"-method above :P You can do that in your Plugin.php and you dont need to change the app directory manually

JeffGoldblum
JeffGoldblum

For future reference I've written a post about how to deal with these packages within your October plugins in a clean and easy to use way. You can view the post here https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/

It covers aspects like registering package configuration, service providers, and aliases through your plugin so that the package can be self contained and not require any project level changes.

Asinox
Asinox

LukeTowers said:

For future reference I've written a post about how to deal with these packages within your October plugins in a clean and easy to use way. You can view the post here https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/

It covers aspects like registering package configuration, service providers, and aliases through your plugin so that the package can be self contained and not require any project level changes.

Dude!!! thank you!

1-7 of 7

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.