In short it uses require
to load in each of the files in the app/config directory in turn and sets the resulting value in a big array wrapped up in some utilities to make accessing values easier.
To achieve this it creates an Illuminate\Config\Repository
and sets values in there based on require
-ing in each of the config files it finds. This is all done in Illuminate\Foundation\Bootstrap
. In the latest version at time of writing this can be seen at https://github.com/laravel/framework/blob/v11.41.3/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php#L96 and https://github.com/laravel/framework/blob/v11.41.3/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php#L110