Retrieving All the Configuration Items

Problem

You want to see all your configuration items.

You suspect something isn't configured correctly and want to get a list of all configuration items.

Solution

Use Config::getItems()

This method will return a multi-dimensional array of all loaded configuration settings.

// Dump all loaded configuration items
var_dump(Config::getItems())

If you want to see the configuration settings for a particular group, use Config::get('groupname').

// Dump all the database settings
var_dump(Config::get('database'));

Discussion

Remember Config::getItems() only outputs loaded items.

If your request never accessed a queue configuration option, then the entire queue group will be missing from the array.

To remedy this, you simply need to access a single option in the group.

Config::get('queue.driver');

// Now the queue group will also be in the output
var_dump(Config::getItems());
comments powered by Disqus