mitchellvanw / laravel-doctrine

NO LONGER MAINTAINED! A Doctrine 2 implementation that melts with Laravel
MIT License
187 stars 74 forks source link

Configuring metadata within a package. #61

Closed neon64 closed 10 years ago

neon64 commented 10 years ago

Hello, I'm trying to use Laravel Doctrine within a package, and I'm struggling to find a good way of adding paths to the metadata configuration array without changing the config file itself.

Is there a recommended way to do this?

I realise one way might be:

Config::set(
    'mitchellvanw/laravel-doctrine::doctrine.metadata',
    array_merge(
        Config::get('mitchellvanw/laravel-doctrine::doctrine.metadata'),
        [
            'foo/bar',
            'baz/qux'
        ]
));

However surely there is a cleaner way to do it.

kirkbushell commented 10 years ago

There's a function in the helpers file for laravel called append_config() that allows you to do exactly that... took me a little while as well. hehe

neon64 commented 10 years ago

Thanks, it works great!