# Correct way to add a file to config/

**URL:** <https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052>\
**Category:** Uncategorized\
**Created:** [August 18, 2017, 5:23pm UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052 "2017-08-18T17:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 18, 2017, 5:23pm UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052/1 "2017-08-18T17:23:59Z")

</div>

I am looking to add a file `merchants.php` which will contain all my merchant config info, api key, etc…

What is the correct way to go about getting that file included?

---

<div class="post-metadata">

**Author:** ![rrd](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/rrd/32/113_2.png) [@rrd](https://discourse.cakephp.org/u/rrd)\
**Post date:** [August 19, 2017, 8:18am UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052/2 "2017-08-19T08:18:35Z")

</div>

Put the file int your /config folder and define a $config array in the file, than load it in your `/config/bootstrap.php`.  
`Configure::load('merchants', 'default', false);`

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 19, 2017, 1:00pm UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052/3 "2017-08-19T13:00:30Z")

</div>

Thank you very much! =]

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 19, 2017, 1:36pm UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052/4 "2017-08-19T13:36:03Z")

</div>

Follow up question…

Im not in a place where I can test just yet, I am awaiting a reset of sandbox credentials…

when I have my array like

```
return [
    'Merchants' => [
        'MERCHANT_LOGIN_ID' => '',
        'MERCHANT_TRANSACTION_KEY' => '',
        'MERCHANT_SANDBOX' => true
    ]
];

```

Do I read it like so?

```
 Configure::read('Merchants.MERCHANT_LOGIN_ID')
```

---

<div class="post-metadata">

**Author:** ![jlroberts](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jlroberts/32/649_2.png) [@jlroberts](https://discourse.cakephp.org/u/jlroberts)\
**Post date:** [August 19, 2017, 1:37pm UTC](https://discourse.cakephp.org/t/correct-way-to-add-a-file-to-config/3052/5 "2017-08-19T13:37:28Z")

</div>

Found it!

[https://book.cakephp.org/3.0/en/development/configuration.html](https://book.cakephp.org/3.0/en/development/configuration.html)

Thank you again!
